typescript

typescript

How to get the previous year in TypeScript

Learn how to get the previous year in TypeScript. The program will print the previous year for a date object in TypeScript.

Read
typescript

How to add one day to a date object in TypeScript

Learn how to add a day to current date or any date in TypeScript. This post will show you how to use the getDate and setDate methods to increment one day in TypeScript date objects.

Read
typescript

How to get the current date in TypeScript

Learn how to get the current date in TypeScript. Learn how to use the Date constructor to print the current date time in TypeScript.

Read
typescript

How to compile and run a TypeScript program

Learn to compile and run a TypeScript program. Learn how to install the typescript compiler, how to compile a typescript program and how to run the generated javascript file.

Read
typescript

4 ways in TypeScript to reverse a string

Different ways in TypeScript to reverse a string. Learn how to reverse a string by using a for loop, using a while loop, by splitting the string and recursively in TypeScript.

Read
typescript

TypeScript program to add two numbers

Different ways in TypeScript to add two numbers. Learn how to add numbers of different types and find the sum of two user given numbers.

Read
typescript

How to create an array of objects in TypeScript

How to create an array of objects in TypeScript. Learn 5 different examples of array object creation in TypeScript

Read
typescript

TypeScript string search method

Typescript string search method search(). We can use a regular expression to use with search or we can directly search for any substring.

Read
typescript

5 ways to convert any to string in typescript

This post will show you five different ways to convert any to string in TypeScript. We will use toString() method, String constructor, by appending an empty string, with string lateral and JSON.stringify to handle JSON values.

Read
typescript

How to create a class in typescript with example

Learn what is class in typescript and how to create objects of classes in typescript. This post will show you examples of classes in typescript.

Read