I would like to remove all falsy values from an array. Falsy values in JavaScript are false, null, 0, \"\", undefined, and NaN.
I think a better deal this way
function bouncer(arr) { arr = arr.filter(function(item) { return item; return arr; bouncer([7, "ate", "", false, 9, NaN, undefined, 0]);