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
16 changes: 16 additions & 0 deletions packages/documentation/copy/en/handbook-v2/Classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,22 @@ class S {
}
```

> This is legal starting ES2022. Note the difference between the tranpiled JavaScript files targetting ES2021 and ES2022.

```js
// javascript output targetting ES2021
class S {
}
S.name = "S!";
```

```js
// javascript output targetting ES2022
class S {
static name = "S!";
}
```

### Why No Static Classes?

TypeScript (and JavaScript) don't have a construct called `static class` the same way as, for example, C# does.
Expand Down
Loading