JavaScript 面向对象 发表于 2018-10-03 | 更新于 2018-12-26 | 分类于 JavaScript | 评论数: | 阅读次数: ES6 class 1234567891011121314151617181920212223class A{ constructor(){ this.type = 'a' } says(say){ console.log(say) }}let a = new A()a.says('hello');// 继承class B extends A{ constructor(){ super() this.type = 'cat' }}