TypeScript 3.0
保留关键字 unknown
unknown未开启 strictNullChecks 时,与 null/undefined 交叉的类型会简化到 null/undefined
strictNullChecks 时,与 null/undefined 交叉的类型会简化到 null/undefinedtype A = { a: number } & null; // null
type B = { a: number } & undefined; // undefined建议
参考
Last updated