TypeScript基础之类型收窄(Type Narrowing)前言类型收窄(Type Narrowing)typeof 类型保护(type guards)真值收窄(Truthiness narrowing)等值收窄(Equality narrowing)in 操作符收窄instanceof 收窄赋值语句(Assignments)控制流分析(Control flow analysis)使用类型谓词(Using type predicates)可辨别联合(Discriminated unions
介绍TypeScript类型收窄(Type Narrowing),包括typeof 类型保护、真值收窄、等值收窄、in 操作符收窄、赋值语句、控制流分析、可辨别联合、never、穷尽检查