Typescript #4: Datatypes in TypeScript

Опубликовано: 24 Февраль 2025
на канале: Codehelp by Sahil
110
8

What is type in ‘Type’script?
Basic types in typescript with examples which I promise will Clear all the doubts u have
So lets get started.

What is type. Lets say I declare a variable and assign it with a value so what type of value is being assigned or what type of value that variable is holding will be the type of that variable.
To illustrate that let me declare a variable a
A = “hello” // in this case the type of a would be string
If I reassign it as a = 10 // then the type would be number
Lets say I do a = true. // then type of a would be boolean
So Type signifies the type of value which the variable can hold or return.

we have used the types before as well if u have any prior knowledge of c++ or java there also we have types declaration of variables .