Skip to content
Merged
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
18 changes: 17 additions & 1 deletion typescript/4-classes/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

We'll cover:

- Basic class syntax in JavaScript
- Basic class syntax in TypeScript
- Adding types to class members
- Visibility modifiers
- Modeling class heritage and relationships
- Abstract classes
- Static properties & methods

---

Expand Down Expand Up @@ -616,3 +617,18 @@ class CurrentAccount extends BankAccount {
// ✅ This is concrete so we can instantiate it
const c = new CurrentAccount();
```

---

## Static methods and properties

Static methods and properties are access on the class itself, not an
instance of the class.

```ts
class CurrentAccount {
static interestRate: number = 0.05;
}

CurrentAccount.interestRate; // 0.05
```
Loading