text: /**
   * Student类
   */
  
  
  
  //创建类测试
  function Student(name, age, country) {
      this.name = name;
      this.age = age;
      this.country = country;
      // setter
      this.setName = function (name) {
          this.name = name;
      }
      // 引用类外方法
      this.yearOfBirth = bornYear;
      this.show = show;
  };
  
  function bornYear() {
      return 2021 - this.age;
  }
  
  function show() {
      console.log("Name: " + this.name + "\nAge: " + this.age + "\nCountry: " + this.country);
  }
  
  //单例模式: (function func() {} )()
  
  /*
  (function main() {
      var student1 = new Student("coulson", 24, "China");
      student1.setName("shville");
      student1.show();
  })();
  */
  
  function main() {
      var student1 = new Student("coulson", 24, "China");
      student1.setName("shville");
      student1.show();
  }
  main();
  
  
  
  
  