前端面试题,利用函数柯里化,实现如下功能
// compose(f1, f2)(f3)(f4)([1, 2, 3]) => f4(f3(f2(f1([1,2,3])))) // function compose() { //todo const argArr = Array.from(arguments); return function fn(...args) { return fn.call(null,) } } function f1(args) { return args.map((a) => a * 1); } function f2(args) { return args.map((a) => a * 2); } function f3(args) { return args.map((a) => a * 3); } function f4(args) { return args.map((a) => a + 3); }求大佬赐教~~