%% generate tags start %%
#software-engineering
%% generate tags end %%
#software-engineering/typescript
```javascript
class Foo {
static Bar = class {
}
}
// works!
var foo = new Foo();
var bar = new Foo.Bar();
```
but nested class cannot have protected and privated member.

it looks like this work:
```ts
class Baz {
baz = 1;
}
class Foo {
private Bar = class extends Baz{ }
}
```
> [!warning] Be aware that doing this means that you create a different class Bar for each instance of Foo.