Skip to content

Commit 1408e66

Browse files
authored
Clarify property renaming example
This section steps the reader through how properties can be renamed. Here, the point is that types must be added separately, after the entire destructuring-with-rename has been accomplished. But as currently written, this line has dropped the property renaming. The example is clearer if the property renaming remains, so the only difference is the introduction of the type annotations.
1 parent c105086 commit 1408e66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/documentation/copy/en/reference/Variable Declarations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ Confusingly, the colon here does _not_ indicate the type.
592592
The type, if you specify it, still needs to be written after the entire destructuring:
593593

594594
```ts
595-
let { a, b }: { a: string; b: number } = o;
595+
let { a: newName1, b: newName2 }: { a: string; b: number } = o;
596596
```
597597

598598
### Default values

0 commit comments

Comments
 (0)