Created
November 1, 2020 09:54
-
-
Save DanShappir/80a2cfadbf17e1b756c29e1b075b0810 to your computer and use it in GitHub Desktop.
Sequence of functions using pipeline operator
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) | |
|> map(#, v => v + 1) | |
|> slice(#, 0, 3) | |
|> Array.from; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment