Created
November 6, 2019 12:26
-
-
Save DanShappir/e18b39121694afaaf765c098511adc93 to your computer and use it in GitHub Desktop.
Simple filter generator
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
You've got a
\t
instead of two spaces on line 3.