套用curry
1 Function.prototype.method = function(name, func) { 2 if (!this.prototype[name]) { 3 this.prototype[name] = func; 4 } 5 }; 6 7 Function.method('curry', function() { 8 var slice = Array.prototype.slice, 9 args = slice.apply(arguments), 10 that = this; 11 return function() { 12 return that.apply(null, args.concat(slice.apply(arguments))); 13 }; 14 });