Skip to content

Instantly share code, notes, and snippets.

@DanShappir
Created November 6, 2019 12:26
Show Gist options
  • Save DanShappir/e18b39121694afaaf765c098511adc93 to your computer and use it in GitHub Desktop.
Save DanShappir/e18b39121694afaaf765c098511adc93 to your computer and use it in GitHub Desktop.
Simple filter generator
function* filter(src, op) {
for (const value of src) {
if (op(value)) {
yield value;
}
}
}
@xehpuk
Copy link

xehpuk commented Jan 20, 2021

You've got a \t instead of two spaces on line 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment