JavaScript

JavaScript Can't Do Maths? 6 Weird Results Explained

2:1312 views

"b" + "a" + +"a" + "a" spells banana in JavaScript. Here are 6 weird things JavaScript does with maths, explained simply for everyone, and how they can break a real business.

TODAY'S LESSON: Computers follow exact rules, not common sense. 1. Turn text into numbers before maths (Number("100") + 50 = 150). 2. Sort with a proper number rule. 3. Test with real data.

Want your prices and totals tested properly Message me: hemantinsights.com/contact?type=project

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