Properties

A class property specifies a key that will be present on an instance object.

Access modifiers

There are three keywords that control access to a property within TypeScript - public, private, and protected.

TypeScript offers a shorthand way to declare and assign class properties directly from the constructor, by adding the public and private access modifiers.

Was this page helpful?