6.接口.js 340 B

12345678910111213141516
  1. (function () {
  2. const obj = {
  3. name: '孙悟空',
  4. age: 20
  5. };
  6. console.log(obj);
  7. class Person5 {
  8. constructor(name, age, sex) {
  9. this.name = name;
  10. this.age = age;
  11. this.sex = sex;
  12. }
  13. }
  14. let a = new Person5('猪八戒', 22, '男');
  15. console.log(a);
  16. })();