r/javascript • • Apr 28 '19

7 Useful JavaScript Tricks

https://davidwalsh.name/javascript-tricks
505 Upvotes

36 comments sorted by

View all comments

6

u/Asmor Apr 29 '19

Re: .filter(Boolean)

Maybe it's just me but I find this more intuitive: .filter(x => x).

At least, if I saw the first thing in a code review, I'd have to stop and think "Wait, does that work? Doesn't it need new?"