One minute
JavaScript - Remove Falsy Elements From an Array
I found this quite clever:
[1, 2, 'b', 0, {}, "", NaN, 3, undefined, null, 5, true, false].filter(Boolean)
> [1, 2, 'b', {}, 3, 5, true]
Read other posts
comments powered by Disqus