JavaScriptShort

true + true + true = 3?! 🤯

0:441,401 views

A viewer commented "true + true + true = 3", and they're right! Here's why JavaScript does maths like this, and how it can break a shop's total.

Today's lesson: computers follow exact rules, not common sense. Always turn text into a number before you add.

Got a weirder one Comment it, and I'll explain it next.

HemantInsights

@hemantinsightsdev14 videos16 Shorts

↑ ↓ to move, Enter to open, Esc to close

Keyboard shortcuts

Ctrl+K
Search tools, articles and projects
/
Search
[
Previous lesson (on articles)
]
Next lesson (on articles)
T
Switch light / dark theme
GthenH
Go to the home page
GthenT
Go to the tools
GthenA
Go to the articles
?
Show this list