$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #184

What is the output?

const s = new Set([1, 1, 2]);
console.log(s.size);
  1. 2
  2. 3
  3. 1
  4. undefined
A Set keeps one copy of each distinct value, and it exposes size rather than length.
Play Problem Solving ▸