Created
September 24, 2020 21:19
-
-
Save wayneseymour/56087300bd40ff2078586314791e001c to your computer and use it in GitHub Desktop.
Filter over an identity fn, as a predicate.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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