Create Composite Functions
// create composite functions
const composite = (...args) => (initialArg) => args.reduceRight((acc, fn) => fn(acc), initialArg);
const sqrt = (value) => Math.sqrt(value);
const double = (value) => 2 * value;
const newFunc = composite(sqrt, double);
// ( 32 * 2 ) ** 0.5
let result = newFunc(32);
console.log(result); // 8