es6实现继承
class User{
constructor(name,age){
this.name=name;
this.age=age;
}
showName(){
alert(this.name);
}
showAge(){
alert(this.age);
}
}
var u1=new User("123","12");
u1.showName();
class vipUser extends User{
constructor(name,age,level){
super(name,age);
this.level=level;
}
showLevel(){
alert(this.level);
}
}
var v1=new vipUser("abc","18",'3");
v1.showName();