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

What is the output?

console.log([1, 2, 3].map(parseInt));
  1. [1, NaN, NaN]
  2. [1, 2, 3]
  3. [NaN, NaN, NaN]
  4. [1, 2, NaN]
map passes the index as radix: parseInt('2',1) and parseInt('3',2) are both NaN.
Play Problem Solving ▸