// static静态方法 不需要去实例化这个类就可以去访问这个类里面的方法
class Food{
static cook(args){
console.log(args);
}
}
//不需要实例化就可以去访问这个类的方法
Food.cook('hello');
class Persion{
constructor(name,birthday) {
this.name = name;
this.birthday = birthday;
}
intro(){
return this.name + this.birthday;
}
}
class Student extends Persion{
constructor(name, birthday) {
super(name, birthday);
}
}
// 使用student类
let student = new Student('zhangsan','2001.2.4 8:02:10');
console.log(student.intro());