Skip to content
Y
yTube.SITE v8.0.4
media / worlds / tools / internet oddities
YouTube / video information

JavaScript Can't Do Basic Math?! 🤯 JS Quiz #1

Video information, playback and saved actions.

JavaScript Can't Do Basic Math?! 🤯 JS Quiz #1

Description: "5" + 2 = "52" but "5" - 2 = 3?! 🤯
JavaScript isn't broken. It's type coercion.

➕ Plus with a string → joins them ("52")
➖ Minus only works with numbers → converts "5" to 5 (3)
✅ Want real math? Use Number("5") + 2 → 7

🧠 YOUR TURN: What is true + t ... Read more
      
Videos related to "JavaScript Can't Do Basic Math?! 🤯 JS Quiz #1"

Related videos are temporarily unavailable.

Try again, or come back later.