套用curry

mac2022-06-30  27

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 });

 

转载于:https://www.cnblogs.com/qzsonline/archive/2012/07/12/2587883.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)