Merge pull request #132 from wjw020206/patch-1
Some checks failed
TypeScript tutorial CI / Generating pages (push) Has been cancelled

docs(object): fixed typo
This commit is contained in:
Ruan YiFeng
2025-08-27 15:01:44 +08:00
committed by GitHub

View File

@@ -228,7 +228,7 @@ let lastName = user.lastName ?? 'Bar';
TypeScript 提供编译设置`ExactOptionalPropertyTypes`,只要同时打开这个设置和`strictNullChecks`,可选属性就不能设为`undefined`
```typescript
// 打开 ExactOptionsPropertyTypes 和 strictNullChecks
// 打开 ExactOptionalPropertyTypes 和 strictNullChecks
const obj: {
x: number;
y?: number;