$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · easy · #86

What is logged?

console.log(parseInt('08'), parseInt('0x1f'), parseInt('12px'));
  1. 8 31 12
  2. 8 0 NaN
  3. 0 31 12
  4. 8 31 NaN
parseInt reads a 0x prefix as hex and stops at the first character it cannot use.
Play Problem Solving ▸