Skip to content
skillbld
Day 2 of 14 30 minAnnotationsInferenceany vs unknown

Write type annotations, let inference do most of the work, and meet the everyday types, any vs unknown, null and undefined, literal types and type aliases.

By the end of today you can

  • Write type annotations for variables, parameters and return values
  • Know when TypeScript infers a type and when you should write one
  • Use the primitive types, arrays and type aliases
  • Explain why unknown is safer than any
  • Handle null and undefined with strict checks

What's inside

  • 6 sections
  • 3 diagrams and mind maps
  • 8 code examples you can run
  • 5-question quiz
  1. 1Type annotations
  2. 2Let inference do the work
  3. 3Arrays
  4. 4any vs unknown
  5. 5null and undefined
  6. 6Type aliases and literal types

Sign in free to read this lesson

Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.

Sign in free
Day 2: Basic Types · TypeScript · SkillBld