Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Create JavaScript Set

// create Set
const set1 = new Set(); // an empty set
console.log(set1); // Set {}

// Set with multiple types of value
const set2 = new Set([1, 'hello', {count : true}]);
console.log(set2); // Set {1, "hello", {count: true}}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Create #JavaScript #Set
ADD COMMENT
Topic
Name
1+2 =