{"size": 838, "ext": "js", "max_stars_repo_path": "5.es6/1.class.js", "max_stars_repo_name": "a-little-sheep/node---", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "5.es6/1.class.js", "max_issues_repo_name": "a-little-sheep/node---", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "5.es6/1.class.js", "max_forks_repo_name": "a-little-sheep/node---", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.4390243902, "max_line_length": 44, "alphanum_fraction": 0.5823389021}
class Person{
  constructor(name){
      //this代表当前组件的实例,私有属性是每个实例所独有的，不共享
      this.name = name;
  }
  //公有的方法,所有的实例共有的方法
  getName(){
    //Student子类的实例
    console.log(this.getAge());
    return this.name;
  }
}
class Student extends Person{
    constructor(name,age){
        //调用父类的构造函数
        super(name);
        this.age = age;
    }
    getAge(){
        return this.age;
    }
}

let obj1= new Student('zfpx',5);
console.log(obj1.getName());


// console.log(Person.country());
// // function Person(name){
// //     this.name = name;
// // }
// // Person.prototype.getName = function(){
// //     return this.name;
// // }
// Person.home = 'beijing';
// //es6的类相当于es5构造函数+原型
// let p = new Person('zfpx');
// console.log(p.getName());
// let s = new Student('zfpx',8);
// console.log(s.getAge());
// console.log(s.getName());