DEV Community

Discussion on: The JavaScript Array.filter() method

Collapse
 
dannyengelman profile image
Danny Engelman

What most resources, including my array-methods.github.io/,

do not mention:

 arr.filter(Boolean)
Enter fullscreen mode Exit fullscreen mode

will filter away all empty/undefined values

Collapse
 
debs_obrien profile image
Debbie O'Brien

nice, thanks