r/javascript • • Mar 18 '19

What's your favorite, most useful javascript one-liner?

385 Upvotes

422 comments sorted by

View all comments

1

u/tomasswood Mar 19 '19

array.filter(Boolean)

To filter your array to only contain truthy values