0Pricing
TypeScript Academy · Lesson

TypeScript Classes and Constructors

Define classes with typed properties and constructors.

Welcome

TypeScript classes are JavaScript classes with type annotations. They combine data and behavior in a typed, object-oriented structure.

Class Declaration with Properties

Declare class properties at the top of the class with their types. TypeScript checks all usages.
class Person {
  name: string;
  age: number;

  constructor(name: string, age: number) {
    this.name = name;
    this.age = age;
  }
}

All lessons in this course

  1. TypeScript Classes and Constructors
  2. public, private, and protected Modifiers
  3. readonly Properties and Parameter Properties
  4. Implementing Interfaces with Classes
← Back to TypeScript Academy