—
myMath = compose(add(3), multiply(4));
myMath(2); // 20
— I prefer it but there is also another reduce function builtin that goes the other way
— And yes I'm aware of returning a function, the alternative being wrapping it in your own
—
const compose = (...funcs) =>
initValue =>
funcs.reduce((value, func) => func(value), initValue);
there
Message permanent page
— What are nomadic function ..., can someone help me with a simple explanation