一、通过给Function.prototype增加方法来使得该方法对所有函数可用Function.prototype.method = function(name,func){ if(!this.prototype[name]){ this.prototype[name] = func; return this; } }通过上面的method方法给Number扩展一个取整的方法integerNumber.method('integer',function(){ return Math[this < 0 ... Read More
posted @ 2013-05-03 17:15 人 在 旅 途 Views(173) Comments(0) Diggs(0)