摘要:
var jane = { hoho: 'Jane', describe: function() { return 'Person named ' + this.hoho; }};var fun = jane.describe; // this 是全局windowcon... 阅读全文
摘要:
Function.prototype.method = function(name,func){ if(!this.hasOwnProperty(name)){ //不能直接用.name判断 返回值为:"Empty" ,还可以用[name] 方式,返回值为:undefine this... 阅读全文
摘要:
1. 扩充类型的功能Function.prototype.method = function(name, func){ if(!this.prototype[name]){ this.prototype[name] = func; } return this;}Str... 阅读全文