Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/documentation/copy/en/handbook-v2/Object Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -942,9 +942,12 @@ function doSomething(pair: [string, number]) {
```

We can also [destructure tuples](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Array_destructuring) using JavaScript's array destructuring.
The labels `text` and `hash` in the example below describe each position in editor hints.
The tuple still accepts the same values as `[string, number]`.
Since TypeScript 5.2, we can also label just some elements, as in `[string, hash: number]`.

```ts twoslash
function doSomething(stringHash: [string, number]) {
function doSomething(stringHash: [text: string, hash: number]) {
const [inputString, hash] = stringHash;

console.log(inputString);
Expand Down