Javascript Set is an inbuilt object that lets you store the unique values of any type, whether there are primitive values or object references. The primary condition of the values should be in one Set is that value in a Set has to be unique, the value equality will be checked.

Getting Started With Sets In Javascript

Sets are the new object type with the ES6 (ES2015) that allows creating collections of unique values. The values in the Set can be either simple primitives like strings or integers, but more complex nonprimitive types like object literals or arrays can also be part of a Set.

Syntax

The syntax of Set is the following.

new Set([iterable]);

#javascript #javascript set #js

Javascript Set: How to Use Sets in Javascript
2.45 GEEK