In this tutorial, you will learn about type castings in TypeScript, which allow you to convert a variable from one type to another type. JavaScript doesn’t have a concept of type casting because variables have…
In this tutorial, you will learn about type assertions in TypeScript. Introduction to Type Assertions in TypeScript Type assertions instruct the TypeScript compiler to treat a value as a specified type. It uses the as keyword to…
In this tutorial, you will learn about the TypeScript intersection types. Introduction to TypeScript intersection types An intersection type creates a new type by combining multiple existing types. The new type has all features of…
In this tutorial, you’ll learn about TypeScript interfaces and how to use them to enforce type checking. Introduction to TypeScript interfaces TypeScript interfaces define the contracts within your code. They also provide explicit names for…
In this tutorial, you will learn about TypeScript abstract classes. Introduction to TypeScript abstract classes An abstract class is typically used to define common behaviors for derived classes to extend. Unlike a regular class, an abstract…
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…
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,…