Classes are useful when data and operations belong together. They are not a replacement for interfaces or plain objects; choose the smallest model that fits.
A class
TypeScript
class Counter { private value = 0; increment(): number { return ++this.value; } }
Access modifiers
public is the default. private restricts access to the class, and readonly allows initialisation but prevents later reassignment. Use these to express an API, not simply to hide every field.
Did you know my courses are all printer-friendly? This means you can easily export them to PDF or print them for later use.
