Shubham Vora has Published 957 Articles

How to find the natural logarithm of a number in TypeScript?

Shubham Vora

Shubham Vora

Updated on 03-Jan-2023 11:48:34

630 Views

The natural logarithm is the logarithm of any numeric value to the base e. Here e is Euler's constant, and the value of Euler’s constant is approximately 2.718. In TypeScript, we can use the built-in library methods to find the natural logarithm of any numeric value greater than or equal ... Read More

How to create an array of objects in TypeScript?

Shubham Vora

Shubham Vora

Updated on 03-Jan-2023 11:46:04

16K+ Views

In TypeScript, the array contains the data or different values and can also contain an object. The object contains the properties and methods in TypeScript. We can access the object properties and invoke the object method by taking the object as a reference. In this tutorial, we will learn to ... Read More

Explain Enum in TypeScript

Shubham Vora

Shubham Vora

Updated on 03-Jan-2023 11:39:00

556 Views

Before getting into “enum, ” it is essential to know about the popular keyword “const” in typescript. When we declare a variable "const", we cannot change the value assigned to it. So, enums are nothing but a collection of these const data types. We can create enums with the help ... Read More

How to find last occurence of element in the array in TypeScript?

Shubham Vora

Shubham Vora

Updated on 03-Jan-2023 11:33:46

3K+ Views

We will learn to find the last index of the element in the array in TypeScript. In development, an array of the data can contain duplicate data, and we may need to keep the last occurrence of the element. For example, we have fetched all users’ login history from the ... Read More

What are type guards in typescript?

Shubham Vora

Shubham Vora

Updated on 19-Dec-2022 16:20:34

3K+ Views

In TypeScript, the type guards are used to determine a variable's type, often inside a conditional or functional block. The type guards usually take the variable and return a Boolean value or the variable type. Type guards allow you to tell the TypeScript compiler to infer a given type for ... Read More

Method Overriding in TypeScript?

Shubham Vora

Shubham Vora

Updated on 19-Dec-2022 16:17:06

15K+ Views

The method overriding means writing the new definition of the method in the inherited class by keeping the method name, parameters, and return type the same. In this tutorial, we will learn about the method overriding in TypeScript. Inheritance is one of the four pillars of object-oriented programming. The method ... Read More

How to use getters and setters in TypeScript?

Shubham Vora

Shubham Vora

Updated on 19-Dec-2022 16:06:17

9K+ Views

In TypeScript, the getters and setters are two terms that can be used to get and set the value of the class members, respectively. However, users can access the public members of the class directly via the dot operator by taking the object of the particular class as a ... Read More

How to sort a 2D array in TypeScript?

Shubham Vora

Shubham Vora

Updated on 19-Dec-2022 16:03:46

5K+ Views

In TypeScript, a 2D array is an array of arrays, where each inner array represents a row of the 2D array. You can access individual elements of the array using bracket notation, with the row and column indices separated by a comma. A single-dimensional array can store values of ... Read More

How to push an element to the last of an array in TypeScript?

Shubham Vora

Shubham Vora

Updated on 19-Dec-2022 16:02:09

3K+ Views

In TypeScript, an array is a data type that represents a collection of elements. Each element in the array has a specific index, or position, in the array, and you can access or modify the elements in the array using their index. In TypeScript, an array can contain elements of ... Read More

How to find the length of a string in TypeScript?

Shubham Vora

Shubham Vora

Updated on 19-Dec-2022 15:56:59

4K+ Views

The string can contain a sequence of repeated and non-repeated characters. The length of the string means the total number of characters the string contains in the sequence of characters, including special characters, alphabetic characters, etc. Here, we will learn different methods to calculate the length of the string in ... Read More

Advertisements