Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
blauditore
on Sept 17, 2018
|
parent
|
context
|
favorite
| on:
JavaScript Equality Minesweeper
But that's not the same; it's about truthy-ness. E.g. -1 and 1 are both truthy, but not loosely equal.
bocytron
on Sept 17, 2018
|
next
[–]
That's weird, I would thought that if(value) was the equivalent of if(value == true). Learned something today!
pythonaut_16
on Sept 17, 2018
|
parent
|
next
[–]
You can force cast a boolean by doing if(!!value == true) {}, but at that point you might as well just say if(value)
paradite
on Sept 17, 2018
|
prev
[–]
You are right. I confused truthy-ness with '== true' for some reason, didn't write much JS lately.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: