Skip to content

Instantly share code, notes, and snippets.

@DanShappir
Created November 6, 2019 12:20
Show Gist options
  • Save DanShappir/55a1198de40c15f79e68acfda710d657 to your computer and use it in GitHub Desktop.
Save DanShappir/55a1198de40c15f79e68acfda710d657 to your computer and use it in GitHub Desktop.
JavaScript iteration methods chaining
const result = numbers
.filter(v => v % 2 === 0) // retain only even numbers
.map(v => v + 1) // increase these numbers
.slice(0, 3); // get the first 3 items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment