Found 26504 Articles for Server Side Programming

How to create a two-dimensional array in TypeScript?

Shubham Vora
Updated on 20-Jan-2023 16:24:59

12K+ Views

A two-dimensional array in TypeScript is an array of arrays, or a matrix, which can be used to represent a table of data, a chess board, or any other type of grid. Two-dimensional arrays are useful when working with a data grid, such as a table or a chessboard. They allow you to store and manipulate data in a structured way and access elements using a pair of indices. Create a two-dimensional array To create a two-dimensional array in TypeScript, users can use an array literal with the desired dimensions, like this − Syntax Users can follow the syntax below ... Read More

How to create function overload in TypeScript?

Shubham Vora
Updated on 20-Jan-2023 16:23:20

1K+ Views

The function or method overloading allows developers to create multiple functions with the same name. Every function contains the same number of parameters but different data types. Also, the return type of the overloaded function can vary. Function overloading is the concept of object-oriented programming. Also, TypeScript supports OOPS, so we can easily implement function overloading in TypeScript. Furthermore, function overloading provides code reusability and helps developers to increase code readability. Let’s understand the use of function overloading via real-life examples. For example, you have created a function that takes a string as a parameter and returns the length of ... Read More

Dynamic Date Populate in TypeScript

Shubham Vora
Updated on 20-Jan-2023 16:21:17

1K+ Views

TypeScript is a strongly typed, object-oriented programming language that enables developers to write code that is cleaner and easier to understand. The dynamic date population theory in TypeScript is that a JavaScript application can automatically populate a calendar, list, or other types of display with the current Date, time, or other dynamic information. This allows developers to create user interfaces that automatically display the current Date, time, or other dynamic information without manually entering the data. This can be especially useful for applications requiring frequent updates or user interaction. To dynamically populate a date in TypeScript, developers can use the ... Read More

Boxing and Unboxing in Typescript

Shubham Vora
Updated on 20-Jan-2023 16:19:14

2K+ Views

The idea of boxing and unboxing is crucial to TypeScript. A value type in TypeScript is automatically converted into a reference type using a process known as boxing. In other words, boxing refers to transforming a value type into a reference type, and unboxing refers to transforming a reference type into a value type. These are two techniques used in TypeScript to convert a value type to an object type. Boxing is the process of wrapping a value type in an object type. In contrast, unboxing is the process of unwrapping an object type back to a value type. The ... Read More

Haskell Program to convert the string into a floating-point number

Akhil Sharma
Updated on 20-Jan-2023 10:21:03

963 Views

This article will help us in converting the string into a floating point number. In Haskell, you can use the read function to convert a string to a floating-point number. Another way to convert a string to a floating-point number is by using the readMaybe function. This function is similar to the read function, but it returns a Maybe value instead of raising an exception when the input string is not valid. All these functions are part of the standard library and we can use them to easily convert strings to a floating point number in Haskell. Algorithm Step ... Read More

Haskell Program to find the hyperbolic arctangent of the given value

Akhil Sharma
Updated on 20-Jan-2023 10:17:56

175 Views

This tutorial will help us in finding hyperbolic arctangent of the given value. The hyperbolic arctangent, also known as the inverse hyperbolic tangent, is the inverse function of the hyperbolic tangent. It is denoted by atanh (or arctanh) and can be defined as atanh(x) = (ln(1+x) - ln(1-x)) / 2 Syntax atanh(angle) Here, atanh() is a function and value is passed as parameter to compute the hyperbolic arctangent of the value passed. It returns a value in the range of (-infinity, infinity). In Haskell, the atanh() function is a part of the Floating class, which is a subclass of ... Read More

Haskell Program to find the hyperbolic arccosine of the given value

Akhil Sharma
Updated on 20-Jan-2023 10:38:18

173 Views

This article will help us in finding hyperbolic arccosine of the given value. The hyperbolic arccosine, also known as the inverse hyperbolic cosine, is the inverse function of the hyperbolic cosine. It is defined as acosh(x) = log(x + sqrt(x^2 - 1)) for x > 1, where log is the natural logarithm. The output of this function is a real number. Syntax acosh(angle) Here, acosh() is a function and value is passed as parameter to compute the hyperbolic arccosine of the value passed and value passed must be greater than 1. Method 1: Using acosh() function In this method, ... Read More

Haskell Program to find the hyperbolic arcsine of the given value

Akhil Sharma
Updated on 20-Jan-2023 10:13:07

163 Views

This tutorial will help us in finding hyperbolic arcsine of the given value. The hyperbolic arcsine (also known as "area hyperbolic sine" or "inverse hyperbolic sine") of a value, denoted as asinh(x), is the inverse function of the hyperbolic sine function (sinh(x)), which is defined as − asinh(x) = ln(x + sqrt(x^2 + 1)) Syntax asinh(angle) Here, asinh() is a function to compute the hyperbolic arcsine of the given value and value is passed as parameter to compute the hyperbolic arcsine of the value passed. It is included in the Prelude module, which is automatically imported into ... Read More

Haskell Program to convert a number into a complex number

Akhil Sharma
Updated on 20-Jan-2023 10:09:09

244 Views

This tutorial will help us in converting a number into a complex number. In Haskell, the Data.Complex library provides a Complex type to represent complex numbers. The :+ operator is used to construct a complex number from its real and imaginary parts. Method 1: Using convertToComplex Function In this approach, the convertToComplex function takes a real number as input and returns a complex number with the real component equal to the sum of the input and the predefinedReal value and the imaginary component equal to the predefinedImaginary value. The main function gets a real number and then uses convertToComplex ... Read More

Haskell Program to convert the string into an integer

Akhil Sharma
Updated on 20-Jan-2023 10:05:49

7K+ Views

This tutorial will help us in converting the string into an integer. In Haskell, the process of converting a string to an integer typically involves using the read function or readMaybe function from the Text.Read module. Another approach is to use the digitToInt function from the Data.Char module to convert each character in the string to its corresponding numerical value. All these functions are part of the standard library and we can use them to easily convert strings to integers in Haskell. Algorithm Step 1 − in-build() function is defined using read function. Step 2 − Program execution will ... Read More

Advertisements