How to Extend Interfaces in TypeScript

In this tutorial, you will learn how to extend an interface that allows you to copy properties and methods of one interface to another. Interfaces extending one interface Suppose that you have an interface called Mailable that contains two…

TypeScript Static Methods and Properties

In this tutorial, you will learn about the TypeScript static properties and methods. Static properties Unlike an instance property, a static property is shared among all instances of a class. To declare a static property,…

TypeScript Inheritance

In this tutorial, you’ll learn about the TypeScript inheritance concept and how to use it to reuse the functionality of another class. Introduction to the TypeScript inheritance A class can reuse the properties and methods of another…

TypeScript Getters and Setters

In this tutorial, you learn how to use the TypeScript getters and setters. Introduction to TypeScript Getters and Setters The following shows a simple Person class with three properties: age, firstName, and lastName: To access any property of the Person class, you…

TypeScript readonly

In this tutorial, you will learn how to use the TypeScript readonly access modifier to mark class properties as immutable property. TypeScript provides the readonly modifier that allows you to mark the properties of a…

TypeScript Access Modifiers

In this tutorial, you will learn about the access modifiers in TypeScript. Access modifiers change the visibility of the properties and methods of a class. TypeScript provides three access modifiers: private protected public Note that TypeScript…

TypeScript Class

In this tutorial, you will learn about the TypeScript Class. Introduction to the TypeScript Class JavaScript does not have a concept of class like other programming languages such as Java and C#. In ES5, you…