Skip to content

Instantly share code, notes, and snippets.

@wayneseymour
Created September 24, 2020 21:19
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 wayneseymour/56087300bd40ff2078586314791e001c to your computer and use it in GitHub Desktop.
Save wayneseymour/56087300bd40ff2078586314791e001c to your computer and use it in GitHub Desktop.
Filter over an identity fn, as a predicate.
id = x => x
results = [1,'',null].filter(id)
console.log(JSON.stringify(results, null, 2))
// => [ 1 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment