You must log in or # to comment.
Did they get ‘truthy’ from The Colbert Report?
Truthy/falsey refers to how types are converted to booleans.
So an empty string is falsey. It’s not false, but when compared as a Boolean it converts to false.
A 0 is falsey, any other number is truthy.One pet peeve of mine is testing libraries having
toBeTruthy
/toBeFalsy
matchers, but nottoBeTrue
andtoBeFalse
. I get that the latter are no shorter thantoBe(true)
, but if the former are listed in the docs, then people who don’t know the terminology will use those - I’ve seen (past) coworkers do that.
Finally we have the Iterator Helper Methods!