Skip to content

Instantly share code, notes, and snippets.

@AviTapp
Last active December 26, 2017 19:13
Show Gist options
  • Save AviTapp/de1aeda9264eeeb26fb6f8d0fe8a4fdd to your computer and use it in GitHub Desktop.
Save AviTapp/de1aeda9264eeeb26fb6f8d0fe8a4fdd to your computer and use it in GitHub Desktop.
Remove all falsy values from an array.
function bouncer(n) {
return n = n.filter(function(n) {
var r = [!1, null, 0, "", void 0, NaN];
for (i = 0; i < r.length; i++) return n != r[i] ? n : void 0
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment