TypeScript: Valid types

I’ve introduced a few types so far.

Valid types are

  • number
  • string
  • boolean
  • void
  • null
  • undefined
  • Array
  • …and more.

Then we have any, a catch-all type that allows any type, which is special in the sense we shouldn’t use it, as it removes many benefits of type checking, but sometimes it’s an “easy way out” from having to define types in a strict way.

Lessons in this unit:

0: Introduction
1: Your first TypeScript program
2: Types
3: Typing functions
4: The editor helps you with type errors
5: Running TypeScript code
6: ▶︎ Valid types
7: Type aliases and interfaces
8: Union types
9: Typing arrays with generics
10: The DX of editing TypeScript
11: There's more...
Want to learn more? Check out our courses