First example. I can't add string just writing it in ()
.
let set = new Set('Emily', 'Mag');
Where's 'Mag'
? String is iterable, why doesn't it add to Set collection?
CodePudding user response:
I think the syntax is slightly off. What you might be looking for is the following:
let set = new Set(['Emily', 'Mag']);
Hope it helps!