class Person{
// 构造方法
constructor(name,id){
this.name = name
this.id = id
this.names = '张三'
}
// 方法
sayHello(){
console.log('hellow i am' + this.name);
}
}
// new 实例
// var person = new Person('张三','123456')
// console.log(person);
// 子继承父
class Son extends Person{
constructor(){
super('son1','9999')
this.height = '180'
}
}
var son1 = new Son()
console.log(son1);