| 123456789101112131415 |
- "use strict";
- (function () {
- class Person {
- constructor(name, age) {
- this.name = name;
- this.age = age;
- }
- say() {
- console.log('我叫' + this.name + ',今年' + this.age + '岁');
- }
- }
- let p = new Person("图图", 3);
- console.log(p, 'p');
- p.say();
- })();
|