Puzzle 2 of 15 · Numeric coercion
Compare subtraction and addition using the same string operand. Predict both console logs while tracking numeric conversion and concatenation. Choose an output below, then check the explanation. No signup needed. Browse puzzles by topic →
1console.log("5" - 2); 2console.log("5" + 2);
Predict the console output. Each line is a separate log.
3 7
52 52
3 52
NaN 7