Search⌘ K

New Object

Explore how to instantiate classes to create unique object instances in TypeScript. Understand the use of the new keyword, object uniqueness, and how class-based objects unlock object-oriented programming features such as interfaces, function overrides, and static methods.

Instantiating a class into an object

TypeScript can create an object by instantiating a class using the keyword new. The scope of this lesson does not cover all object-oriented possibilities but in a nutshell, TypeScript lets you use the full set of object-oriented features, even ECMAScript before 2015, which does not contain Object or literal object.

This means that if you want to use polymorphism, have multiple instances of a ...