| 123456789101112131415161718192021 |
- "use strict";
- (function () {
- /**
- * 类型别名 接口区别
- * 接口:偏向 对象/结构的定义 可扩展 可合并
- * 类型别名:偏向于任意类型 联合/交叉类型 简单的别名
- * */
- // 类实现接口 需要继承
- // 类型约束
- class List {
- constructor(name, age, address, sex, x) {
- this.name = name;
- this.age = age;
- this.address = address;
- this.sex = sex;
- this.x = x;
- }
- }
- let x = new List('图图', 3, '上海', '12');
- console.log(x);
- })();
|