Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@irene
> const list = [13, null, undefined, 16, '',17, 0];
> const filtered = list.filter(Boolean);
> filtered
> [ 13, 16, 17 ] -
@irene he's not doing truthiness coercion, he's converting to Boolean.
i have no idea what a "legit zero" is also 😂😂😂
https://developer.mozilla.org/en-US...
im messing with you -
@irene you know, for a second OP had me believing that checking truthiness wasn't the same as Boolean(value),
wow, I knew 'Boolean(0) === false' for a long time, but for a moment I thought it wasn't, and then remember that it kinda is fucked up that 'Boolean(0) === false'
Related Rants
JS shortcut
devrant
js