CodePeek
Practice / ValuesBack to CodePeek

JavaScript String coercion: A plus with a twist

Puzzle 1 of 15 · String coercion

Read a chain of JavaScript + operators with numbers and a string. Predict what console.log prints as each operation is evaluated. Choose an output below, then check the explanation. No signup needed. Browse puzzles by topic →

Values / String coercionJavaScript
console.log(1 + "2" + 3);

Predict the console output. Each line is a separate log.

What’s the output?

Choose the output

Starter puzzles 15