Last active
September 9, 2020 19:07
-
-
Save ashwinkumar2438/c23bb6cb68d2e7098edfba66088b2340 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Compose Function | |
var compose=(...args)=>(input)=>args.reduceRight((acc,fn)=>fn(acc),input); | |
var resulant=compose(h,g,f); //(input)=>h(g(f(input))); | |
// Pipe Function | |
var pipe=(...args)=>(input)=>args.reduce((acc,fn)=>fn(acc),input); | |
var resulant=pipe(f,g,h); //(input)=>h(g(f(input))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment