← Quiz: Classes, Modules, Map and Set: all 10 questions
Quiz: Classes, Modules, Map and Set · Question 3 of 10
What does this print? (code)
What does this print?
console.log(new Set([3, 1, 3, 2, 1]).size);
- A.5
- B.3
- C.2
- D.1
Answer & explanation
Correct answer: 3
A Set keeps only unique values: 3, 1 and 2.
Can you get the rest right without peeking?
Take the timed Quiz: Classes, Modules, Map and Set quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →