摘要: var jane = { hoho: 'Jane', describe: function() { return 'Person named ' + this.hoho; }};var fun = jane.describe; // this 是全局windowcon... 阅读全文
posted @ 2015-03-11 18:09 lcw5945 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Function.prototype.method = function(name,func){ if(!this.hasOwnProperty(name)){ //不能直接用.name判断 返回值为:"Empty" ,还可以用[name] 方式,返回值为:undefine this... 阅读全文
posted @ 2015-03-11 16:55 lcw5945 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1. 扩充类型的功能Function.prototype.method = function(name, func){ if(!this.prototype[name]){ this.prototype[name] = func; } return this;}Str... 阅读全文
posted @ 2015-03-11 14:23 lcw5945 阅读(148) 评论(0) 推荐(0) 编辑