Skip to content

Instantly share code, notes, and snippets.

@DanShappir
Last active November 1, 2020 09:59
Show Gist options
  • Save DanShappir/82af7f33fce30dd56af8a5942a3e978e to your computer and use it in GitHub Desktop.
Save DanShappir/82af7f33fce30dd56af8a5942a3e978e to your computer and use it in GitHub Desktop.
Filter for use with pipeline operator
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