Menu
Only three hard problems: cache, naming, and off-by-one errors.
Home
Hot
Random
Search
Browse
AI
AWS
Agile
Algorithms
Android
Apple
Azure
Backend
Bash
C++
Cloud
All Categories
HTTP 418: I'm a teapot
The server identifies as a teapot now and is on a tea break, brb
HTTP 418: I'm a teapot
The server identifies as a teapot now and is on a tea break, brb
Octal-numbers Memes
Posts tagged with Octal-numbers
No Doubt Javascript
Javascript
Programming
Webdev
10 months ago
386.4K views
1 shares
JavaScript's type coercion strikes again with its legendary logic. Using the strict equality operator (===), octal 017 doesn't equal decimal 17 because JavaScript interprets that leading zero as "hey, this is octal!" (which is 15 in decimal). But 018? That's not a valid octal number, so JS just shrugs and treats it as decimal 18. Then comes the double equals (==) where JavaScript becomes the chaos agent we all know and love. It converts the string to a number and suddenly everything makes sense... in the most JavaScript way possible. The language where "wat" is a valid reaction and type coercion is both your best friend and worst enemy. This is why we have trust issues.
Today's picks
Panvola There Is No Place Like 127.0.0.1 Programmer Gifts For Husband Boyfriend Brother Localhost Coder IT Programming Students Teacher Software Engineer Gifts Ceramic Mug 11 oz White
Affiliate
$12.97
NordVPN
Sponsored
VPN
I’m not a robot*
Programming
131.2K views
5 years ago