• constructor
    • 属性
    • 方法 ```javascript class Student {
      1. constructor(name, number) {
      2. this.name = name;
      3. this.number = number;
      }
      1. sayHi () {
      2. `姓名 ${this.name} , 学号 $ {this.number}` // es6
      } }

    // 通过类声明对象/实例 const xialuo = new Student(‘夏洛’, 100); console.log(xialuo.name); console.log(xialuo.number); xialuo.sayHi(); ```