Skip to content

Instantly share code, notes, and snippets.

@chickenfoot88
Created July 1, 2019 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chickenfoot88/73b63d6b5ebf86c7fd71e3cf07bc7440 to your computer and use it in GitHub Desktop.
Save chickenfoot88/73b63d6b5ebf86c7fd71e3cf07bc7440 to your computer and use it in GitHub Desktop.
removes false, null, undefined, 0, empty string
let dirty = [ 1, null, false, 2, 3, null, 5, 0, 10, '']
const clean = dirty.filter(Boolean);
console.log(clean)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment