← BYTES
JavaScript·Starter·Ref: 3.1.19

What does `console.log(1 + "1")` print?

Have a question about this video? Mention reference 3.1.19 when you contact us.

a.2
b."11"
c.NaN
d.undefined
Because one operand is a string, `+` coerces the number 1 to the string "1" and concatenates, printing the string "11" rather than performing numeric addition.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES3119#JavaScript