60 ms·
I forget the specifics of Javascript, but in many languages "truthy" (used in ifs) is usually closer to "!= false" than "== true". e.g. any object or non-zero
by Groxx 12y ago
I forget the specifics of Javascript, but in many languages "truthy" (used in ifs) is usually closer to "!= false" than "== true". e.g. any object or non-zero number is truthy (except "" in JS), but only a handful are actually == true or == false.
- deleted 12y ago[deleted]
- farnsworth 12y agoGood point, same in JS: if (2 != false) console.log('yes') > yes false goes to 0 and 2 != 0.