题解 | #柯里化#
柯里化
https://www.nowcoder.com/practice/bb78d69986794470969674a8b504ac00
function curryIt(fn) { let args=[] return (a)=>{ args.push(a) return (b)=>{ args.push(b) return (c)=>{ args.push(c) return fn(...args) } } } }
柯里化
https://www.nowcoder.com/practice/bb78d69986794470969674a8b504ac00
function curryIt(fn) { let args=[] return (a)=>{ args.push(a) return (b)=>{ args.push(b) return (c)=>{ args.push(c) return fn(...args) } } } }
相关推荐