Last active
January 10, 2023 17:51
-
-
Save hesan-aminiloo/ba1687a19f57e8284caa6b3bef52635f to your computer and use it in GitHub Desktop.
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
/** | |
* Compose multiple functions together | |
* | |
* @param fns Array of funcitons | |
* @returns function | |
*/ | |
const compose = (...fns) => (param) => | |
fns.reduceRight((y, f) => f(y), param); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment