We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Remove all falsy values from an array. Falsy values in JavaScript are false, null, 0, "", undefined, and NaN.
false
null
0
""
undefined
NaN
function bouncer(arr) { return arr.filter(function(el) {return el;}); } bouncer([7, "ate", "", false, 9]); // returns [7, 'ate', 9]