What does this JavaScript expression print?
console.log("1" + 1);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.
Practice types & coercion with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
console.log("1" + 1);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.