DEV Community

loading...

Discussion on: 14 Awesome JavaScript Array Tips You Should Know About

Collapse
thelogicwarlock profile image
Kaemon Lovendahl

You can also do [1, 2, 3, 4, null, 5, undefined].filter(Boolean) to remove falsey values.