$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · hard · #213

What is the output?

console.log([0, 1, 2].map(String).filter(Boolean));
  1. ['1', '2']
  2. [1, 2]
  3. ['0', '1', '2']
  4. [true, true, true]
After map every item is a non-empty string, and even '0' is truthy.
Play Problem Solving ▸