List the built-in types in Typescript

Technology CommunityCategory: TypeScriptList the built-in types in Typescript
VietMX Staff asked 3 years ago

These are also called the primitive types in TypeScript:

  • Number type: it is used to represent number type values and represents double precision floating point values.
var variable_name: number;
  • String type: it represents a sequence of characters stored as Unicode UTF-16 code. It is the same as JavaScript primitive type.
var variable_name: string;
  • Boolean type: in Typescript, it is used to represent a logical value. When we use the Boolean type, we get output only in true or false. It is also the same as JavaScript primitive type.
var variable_name: bool;
  • Null type: it represents a null literal and it is not possible to directly reference the null type value itself.
var variable_name:number = null;
  • Undefined type: it is the type of undefined literal. This type of built-in type is the sub-type of all the types.
var variable_name:number = undefined;