What are the primitive types in TypeScript?

Beginner

Answer

TypeScript supports all JavaScript primitive types plus additional ones:

  • string: Text data
  • number: Numeric values (integers and floats)
  • boolean: True/false values
  • null: Intentional absence of value
  • undefined: Uninitialized value
  • symbol: Unique identifiers
  • bigint: Large integers
  • void: Absence of return value
  • never: Values that never occur
  • any: Disables type checking
  • unknown: Type-safe alternative to any