• 联合类型

      1. let a: string | number; // string | number就是一个联合类型
    • 类型别名 ```typescript // 类型别名和interface很多情况下可以互换

    type Person = { name: string }; // 类型别名

    interface Person { name: string;} // interface

    // 在使用联合类型或者交叉类型的情况下,interface无法代替type

    type sn = string | number; let b: sn;

    // interface 也没法实现Utility type ```