We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent abcc074 commit 5459b3cCopy full SHA for 5459b3c
docs/types.md
@@ -129,9 +129,11 @@ const x:null = null;
129
130
上面示例中,变量`x`就属于 null 类型。
131
132
-注意,如果没有声明类型的变量,被赋值为`undefined`或`null`,它们的类型会被推断为`any`。
+注意,如果没有声明类型的变量,被赋值为`undefined`或`null`,在关闭编译设置`noImplicitAny`和`strictNullChecks`时,它们的类型会被推断为`any`。
133
134
```typescript
135
+// 关闭 noImplicitAny 和 strictNullChecks
136
+
137
let a = undefined; // any
138
const b = undefined; // any
139
@@ -143,6 +145,7 @@ const d = null; // any
143
145
144
146
147
// 打开编译设置 strictNullChecks
148
149
let a = undefined; // undefined
150
const b = undefined; // undefined
151
0 commit comments