Leaderboard Archive
Javascript Apr 25, 2026

What does this print?

let x = "5"
let y = 3
console.log(x - y)
A "53"
B 2
C NaN
D TypeError
Explanation
The minus sign (-) always converts strings to numbers before doing math. So "5" becomes 5, and 5 minus 3 equals 2. Only the plus sign (+) causes string joining — every other math operator forces number 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 →