摘要:
书中有一节讲给类型添加方法,讲解的示例如下:Function.prototype.method = function(name, func) { this.prototype[name] = func; return this;};Number.method('integer',function() { return Math[this < 0 ? 'ceiling' : 'floor'](this);});有没有疑问呢?method是函数类型的方法,如果有var fun = function(){};自然fun可以调用method方法,即 阅读全文
posted @ 2011-10-28 15:43
houyulei
阅读(495)
评论(0)
推荐(0)
浙公网安备 33010602011771号