目录

类之间的继承关系

# 继承的概念

class Person{
  constructor(name, age){
    this.name = name
    this.age = age
  }
  running(){
  }
  eating(){
  }
}
class Student extends Person{
}
var stu = new Student('zs', 18)
stu.eating()
stu.running()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

# 继承的好处

  1. 增加代码复用性
上次更新: 2022/09/02, 08:35:13
最近更新
01
防抖和节流
02-06
02
正则表达式
01-29
03
async_await函数
12-30
更多文章>