In this tutorial, you’ll learn about TypeScript generics that allow you to use types as formal parameters. Introduction to TypeScript Generics TypeScript generics allow you to write the reusable and generalized form of functions, classes, and interfaces….
In this tutorial, you will learn about the Type Guard in TypeScript Type Guards allow you to narrow down the type of a variable within a conditional block. typeof Let’s take a look at the following…
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…