TypeScript

NaN in Typescript

N in Typescript stands for Not a Number. It is the result of numerical operations, where result is not a number. It is the property of the global object. You can refer it either as NaN or Number.NaN. The typeof NaN is primitive number. We can check whether a value is NaN by using the isNaN function or by Number.IsNan method.

NaN in Typescript Read More »

Template Strings, String interpolation & multi-line Typescript

Template literals (or Template strings ) in Typescript are multiline string literals allowing embedded expressions. You can use multi-line strings, basic string formatting, string interpolation & tagged templates with them. They are part of ES2016/ES6 specification. Template literals are also called as template strings. In this tutorial, we will learn the Template Literals syntax and how to use it in Multi line Strings & string interpolation. We will also learn how to nest expressions and how to Escaping template literals using the backslash (\)

Template Strings, String interpolation & multi-line Typescript Read More »

TypeScript String

We use Typescript string to store the textual data. It is a primitive data type in typescript. We enclose string data in double-quotes (“) or single quotes (‘). We can also define them using the Template literal syntax or back-tick. Such strings are called Template strings, The Template strings can be used to create multi-line strings, strings with embedded expressions & Tagged Template strings. The Typescript also has a String object, which is a wrapper around a primitive string. In this tutorial, we learn about typescript strings. We also find out the difference between String vs string. Finally, we also look at the list of typescript string functions.

TypeScript String Read More »

Type Inference in typescript

Typescript infers the Data type of the variable, even if there is no type is declared. We call this Type Inference. We learned how to declare the variable in typescript in the tutorial. We learnt that the types can be declared without declaring its type. In this tutorial, we will learn how typescript makes an attempt to infer the type in many ways.

Type Inference in typescript Read More »

Scroll to Top