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

What is logged?

console.log(+true, +'', +'3');
  1. 1 0 3
  2. true 0 3
  3. 1 NaN 3
  4. 1 0 '3'
Unary + converts to a number: true is 1 and the empty string is 0.
Play Problem Solving ▸