Last active
November 1, 2020 09:59
-
-
Save DanShappir/82af7f33fce30dd56af8a5942a3e978e to your computer and use it in GitHub Desktop.
Filter for use with pipeline operator
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
function* filter(src, op) { | |
for (const value of src) { | |
if (op(value)) { | |
yield value; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment