摘要: class Circle { constructor(radius) { this.radius = radius; Circle.circlesMade++; }; static draw(circle, canvas) { // Canvas绘制代码 }; static get circlesM 阅读全文
posted @ 2018-05-31 12:19 我是格鲁特 阅读(365) 评论(0) 推荐(0)
摘要: 创建对象7种方法 继承的六种实现方式 1.原型链继承 让子类共享父类的方法,其关键实现就是让一个原型对象指向另一个类型的实例 1 function Parent(){ 2 this.colors = ['blue','green']; 3 } 4 Parent.prototype.addColor 阅读全文
posted @ 2018-05-31 09:27 我是格鲁特 阅读(162) 评论(0) 推荐(0)