HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by paradite | Hacker News Reader
Parent
Full thread
paradite
·
People who writes `if(value)`
View on HN
blauditore
·
But that's not the same; it's about truthy-ness. E.g. -1 and 1 are both truthy, but not loosely equal.
paradite
·
You are right. I confused truthy-ness with '== true' for some reason, didn't write much JS lately.
paulintrognon
·
That's weird, I would thought that if(value) was the equivalent of if(value == true). Learned something today!
pythonaut_16
·
You can force cast a boolean by doing if(!!value == true) {}, but at that point you might as well just say if(value)
Reply on news.ycombinator.com