柯里化
- 延时计算
- 通用写法1234567891011121314151617181920var currying = function (fn) {var _args = [];function base() {if (arguments.length === 0) {return fn.apply(this, _args);} else {Array.prototype.push.apply(_args, [].slice.call(arguments));return logic;}}return base;};var add = currying(function(){return [].slice.call(arguments).reduce(function(a,b){return a + b;});})add(1,2,3)(4)(5)();