Menu

Classes, Enums, and Object-Oriented Patterns

Module 6: Classes, Enums, and Object-Oriented Patterns

Introduction

Classes group data and behaviour together: a shopping cart that holds items and knows how to calculate its total, or a payment processor that validates and charges. TypeScript adds type checking, access control, and contracts to JavaScript classes.

This module covers typed classes, public, private, and protected members, inheritance and abstract classes, implementing interfaces, and TypeScript-only features such as enums, including when modern alternatives are a better fit.

What you will learn in this module

  • How to type class fields, constructors, and methods
  • How access modifiers, readonly, and #private fields protect data
  • How to use inheritance, abstract classes, implements, and override
  • How enums work, and when to prefer union types or as const objects
  • What "erasable syntax" means for modern tools and Node.js

TypeScript Tutorial

J

Jebasta





Get in Touch For Details