Javascript
Apr 18, 2026
What is the output?
console.log(2 + "2")
console.log(2 - "2")
Explanation
+ with a string triggers concatenation. - always tries numeric conversion.
📝
Reviewed by CodeShot Editorial
Every challenge is code-reviewed by senior developers to ensure accuracy and real-world relevance. Learn more.