Q3: What are the primitive types available in TypeScript?

Difficulty:EasyTopic:Primitives

TypeScript supports all native JavaScript primitives alongside type additions:

  • string: Textual data.
  • number: Floating-point numbers and integers.
  • boolean: True/false values.
  • bigint: Large integers beyond $2^{53} - 1$.
  • symbol: Unique, immutable identifiers.
  • null & undefined: Absence of value or uninitialized state.
  • void: Signals absence of return value from functions.
Key Takeaways
  • Primitive types in TypeScript correspond directly to JavaScript's runtime primitive types.
  • Always use lowercase primitive names (string, number) rather than wrapper objects (String, Number).