Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
![](/static/devrant/img/pipeless-devrant-banner-white.png)
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Root8234281dI don’t think so.
Zero should, but negatives are “present” (to use a Rubyism) so they would be truthy. -
jestdotty408681dno but you can make -1 (which is returned when you try to find something in an array and it isn't in the array) be false using ~
false is on 0, positive and negative numbers have bits in them therefore will evaluate to true -
Lensflare1588981dI bet there are countless js devs who write code which relies on this and they think that they are super clever 10x devs.
-
Parzi884880dI'm pretty sure the true/false comparison compares to 0 exactly. Python does the same thing, and it lets you get up to some useful signaling bullshit (return either False or an object, easier to check for than NoneType because you can "if not var:" and NoneType is still an object so this check will fail)
Mandela effect
I swear negative numbers used to evaluate as false in Javascript?!
Wtf ?! 😳
rant
mandela effect
javascript