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
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
