基于构造函数的五种继承方法小结【点击查看详情】
基于构造函数的五种继承方法小结:1.使用call或apply绑定构造函数 animal.apply(this.arguments) 2.使用prototype属性 Cat.prototype = new Animal(); Cat.prototype.constructor = Cat; var cat1 = new Cat(大毛,黄色); alert(cat
相关视频/文章