2019年1月13日

js 构造函数的原型对象属性或方法的读取或写入

摘要: function Func() {}Func.prototype.obj = { x: 1, y: 2};Func.prototype.basic = 'basic';//var a = new Func();var b = new Func();a.obj.x = 10;a.obj.y = 20; 阅读全文

posted @ 2019-01-13 16:03 WINSH 阅读(350) 评论(0) 推荐(0) 编辑

js构造函数内存在的闭包

摘要: function Func(x) { this.x = x; this.print=function() { console.info(this.x); (function (){ console.info(x); })(); }}var a = new Func(30);console.dir(a 阅读全文

posted @ 2019-01-13 11:52 WINSH 阅读(542) 评论(0) 推荐(0) 编辑

导航