I wanted to combine two or more functions to produce a new function.
How can I create a function that performs left-to-right function compositions by returning a function that accepts one argument?
For example:
const square = v => v * v;
const double = v => v * 2;
const addOne = v => v + 1;
const cal = myFunction(square, double, addOne);
cal(2) // 9; addOne(double(square(2)))