cft

Future Javascript: Built in function composition (pipeline operator)

pipeline operator


user

abidi marwen

2 years ago | 1 min read

function composition is a way of combining multiple function to build more complicated one you can define your own compose function :

or you can use a third party library like lodash i usually use "_.flow()" method but now when i read about pipeline operator . i'm so exited to implemented on my work but this proposal on stage 2 (experimental phase) we should wait 2 more stage until the official release . i can't wait all that time so i used a polyfill to test it : this is the link of this proposal to read more about it :[github.com/tc39/proposal-pipeline-operator]

so now let's dive in my best new feature until now : pipeline operator|> let do the same example of compose function :

we pass 10 to the addition function and then we pass the result of addition function to subtraction function and % represent the argument of the function

"that's all I've got. Goodbye." at least for now because i kinda enjoying writing blogs so let's meet in another blog

Upvote


user
Created by

abidi marwen


people
Post

Upvote

Downvote

Comment

Bookmark

Share


Related Articles