strictNullChecks 关闭

关闭 strictNullChecks,可能是 nullundefined 的值仍然可以正常访问,并且值 nullundefined 可以分配给任何类型的属性。 这类似于没有空检查的语言(例如 C#、Java)的行为方式。 缺乏检查这些值往往是错误的主要来源;如果在他们的代码库中这样做是可行的,我们总是建议人们打开 strictNullChecks

With strictNullChecks off, values that might be null or undefined can still be accessed normally, and the values null and undefined can be assigned to a property of any type. This is similar to how languages without null checks (e.g. C#, Java) behave. The lack of checking for these values tends to be a major source of bugs; we always recommend people turn strictNullChecks on if it's practical to do so in their codebase.