Created
November 6, 2019 12:22
-
-
Save DanShappir/3a0915a1c53fe4ed1df840269064e0c5 to your computer and use it in GitHub Desktop.
lodash 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 result2 = _(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 | |
.value(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment