PRACTICE / UNDERSTAND / REPEAT

JavaScript practice question

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

1 questionAnswers explainedFree · no login

Try this question

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.