MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/bidtu1/7_useful_javascript_tricks/em1j90k/?context=3
r/javascript • u/xxammuxx • Apr 28 '19
36 comments sorted by
View all comments
6
Re: .filter(Boolean)
.filter(Boolean)
Maybe it's just me but I find this more intuitive: .filter(x => x).
.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?"
new
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?"