Closed
Description
这一小段有点问题,https://wangdoc.com/typescript/types#undefined-%E7%B1%BB%E5%9E%8Bnull-%E7%B1%BB%E5%9E%8B。
开启了strictNullChecks,const b = undefined 应该被推断为undefined类型,const d = null 应该推断为 null类型。
具体原因不懂,个人认为是因为const定义的变量不可修改,所以定义时就可以推断出类型。
Metadata
Metadata
Assignees
Labels
No labels