1 min read 134 words Updated Sep 24, 2026 Created Sep 24, 2026
#TypeScript

Basic types

TypeScript has a rich set of built-in types, which can be categorized into the following groups:

  1. Primitive types: These are the basic data types in TypeScript, including number, string, boolean, null, and undefined.
  2. Object types: These include object, array, function, and class.
  3. Union types: These allow you to combine multiple types into one.
  4. Any type: This type can hold any value, and is used when the type of a variable is not known.
  5. Void type: This is used to indicate that a function does not return a value.

In more detail

undefined

undefined = not assigned. Thus, variables which have no value assigned are undefined. It is not the same as null. See next.  

null

null = intentionally empty.

any

I have