4 ms·
But that's not the same; it's about truthy-ness. E.g. -1 and 1 are both truthy, but not loosely equal.
by blauditore 8y ago
But that's not the same; it's about truthy-ness. E.g. -1 and 1 are both truthy, but not loosely equal.
- paradite 8y agoYou are right. I confused truthy-ness with '== true' for some reason, didn't write much JS lately.
- paulintrognon 8y agoThat's weird, I would thought that if(value) was the equivalent of if(value == true). Learned something today!
- pythonaut_16 8y agoYou can force cast a boolean by doing if(!!value == true) {}, but at that point you might as well just say if(value)