I would like to remove all falsy values from an array. Falsy values in JavaScript are false, null, 0, \"\", undefined, and NaN.
Using this simple filter will do:
array.filter(Boolean)
You can read more about Boolean here
Boolean