关于继承
来源:5-3 如何用 class 实现继承

所向无一
2020-10-18
在子类中如果访问父类的属性和方法? 请举例
写回答
1回答
-
双越
2020-10-18
class A { constructor() { this.name = 'a' } getName() { return this.name } } class B extends A { hello() { const name = this.getName() return `hello, I am ${name}` } }
032020-10-18
相似问题