摘要: /** obsolete syntax **/ var Person = Class.create(); //通过Class.create方法创建空类 Person.prototype = { //把方法定义到prototype中,注意,是通过initalize方法初始化类的属性和数据 initia 阅读全文
posted @ 2020-12-30 17:14 之鹿喵 阅读(733) 评论(0) 推荐(0) 编辑
摘要: 我们最常用的方法是: //使用constructor模式 function a(user,pwd){ //use constructor this.user = user; this.pwd = pwd; return this;} //使用factory模式 function a2(user,pw 阅读全文
posted @ 2020-12-30 16:13 之鹿喵 阅读(188) 评论(0) 推荐(0) 编辑