6.接口.js 314 B

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