Leaderboard Archive
Javascript Apr 18, 2026

What is the output?

console.log(2 + "2")
console.log(2 - "2")
A "22" and 0
B 4 and 0
C "22" and "0"
D 4 and "0"
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.

Ready for your shot?

Join thousands of developers solving one logic puzzle every morning.

Solve Today's Challenge →