set addd javascript code example
Example: add to set js
const mySet = new Set();
mySet.add(15);
mySet.add(33);
mySet.add(15);
for(let item of mySet) {
console.log(item)
// expected output: 15
// expected output: 33
}
const mySet = new Set();
mySet.add(15);
mySet.add(33);
mySet.add(15);
for(let item of mySet) {
console.log(item)
// expected output: 15
// expected output: 33
}