CodePeek · Free JavaScript classroom challenge

What does it print?

LEARNER HANDOUT · Three output predictions

Name: Date:

Read each snippet independently. Write what each console.log prints, one output per line. String outputs are shown without quotes. Predict first, then compare and discuss.

1. String coercion

console.log(1 + "2" + 3);

My predicted output:

2. Numeric coercion

console.log("5" - 2);
console.log("5" + 2);

My predicted output:

3. Equality

console.log(0 == false);
console.log(0 === false);

My predicted output: