Created
June 28, 2020 10:51
-
-
Save hw0k/8209ece9c440c67f0158cce401951381 to your computer and use it in GitHub Desktop.
FND 8
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
function pipe(...functions) { | |
return input => functions.reduce((value, func) => func(value), input); | |
} | |
function compose(...functions) { | |
return input => functions.reduceRight((value, func) => func(value), input); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment