01.ts 181 B

123456789101112
  1. let a: number;
  2. a = 4;
  3. // &表示同时
  4. let j: {name: string} & {age: number};
  5. j = {name: 'ddd',age: 33};
  6. // 类型别名
  7. let k: 1 | 2 | 3;
  8. type myType = 1 | 2 | 3;
  9. let m: myType;