Easy
Understanding Set Operations in JavaScript: Adding, Removing, and Converting to Array
What does the following code log to the console?
1const set = new Set([1, 2, 3, 2, 1]);2set.add(4);3set.delete(2);4console.log([...set]);
What does the following code log to the console?
1const set = new Set([1, 2, 3, 2, 1]);2set.add(4);3set.delete(2);4console.log([...set]);