print set in js code example
Example: set in javascript
// set is used for storing unique values
const firstSet = new Set([1, 2, 3]);
firstSet.add('hi'); //adding value to set
firstSet.add(3); //this will not give any error and it will also not be added
firstSet.delete('hi');//removing value from set
console.log(firstSet.has('hi'));//checking 'hi' is in the set or not
// showing all values in the set
console.log(firstSet);
for (const entry of firstSet.values()) {
console.log(entry);