how to understand conditional types with null

前端 未结 0 1533
鱼传尺愫
鱼传尺愫 2020-12-16 23:01

For example,

type T = (string |null) extends string? object: number;

Per Typescript, since (string |null) is NOT assignable

相关标签:
回答
  • 消灭零回复
提交回复
热议问题