Created
November 6, 2019 12:20
-
-
Save DanShappir/55a1198de40c15f79e68acfda710d657 to your computer and use it in GitHub Desktop.
JavaScript iteration methods chaining
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
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