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

What is the output?

console.log(Number(' 12 '), Number('1_000'), Number(null));
  1. 12 1000 0
  2. 12 NaN 0
  3. NaN NaN 0
  4. 12 NaN NaN
Number trims whitespace, rejects numeric separators inside strings, and converts null to 0.
Play Problem Solving ▸