Hacker News new | past | comments | ask | show | jobs | submit login

But that's not the same; it's about truthy-ness. E.g. -1 and 1 are both truthy, but not loosely equal.



That's weird, I would thought that if(value) was the equivalent of if(value == true). Learned something today!


You can force cast a boolean by doing if(!!value == true) {}, but at that point you might as well just say if(value)


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: