PRACTICE / UNDERSTAND / REPEAT

JavaScript: Types & coercion

Practice types & coercion with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

20 questionsAnswers explainedFree · no login
Question 1 of 20
Types & coercion · MCQQuestion link ↗

What does this JavaScript expression print?

console.log("1" + 1);
Choose one answer
Answer & explanation

Answer: "11"

When either operand of + is a string, the other is converted to a string and concatenated. Quotes in the answer denote a string.