"use strict"; (function () { /** * 抽象类 与其他类差别不大 abstract * 抽象类不是为了实例化对象 * 它是因继承而产生的类 */ class Animal { constructor(name) { this.name = name; } } class A extends Animal { eat() { console.log(this.name + "吃了很多饭"); } } let a = new A("狗狗"); a.eat(); })();