Wun Code
TypeScript

TypeScript Basics

Write JavaScript with types that the real TypeScript compiler checks before your code ever runs.

Start the trackFree, no sign-up needed

What you'll learn

  • Your first typeCatch the bug before the code runs
  • Type inferenceWrite a type only when you need one
  • Union types and narrowingA value with more than one type
  • Object interfacesName an object's shape once
  • Type aliasesNaming and combining types
  • Optional and readonly fieldsWhat may be missing and what never changes
  • Literal typesA fixed set of values
  • Arrays and tuplesA fixed length, and the original array stays put
  • Function typesPassing functions and optional parameters
  • The unknown type instead of anyCheck a value before you use it

Track contents

10 lessons, 2 hours in total
  1. 1Your first typeTypeScriptCatch the bug before the code runs
  2. 2Type inferenceTypeScriptWrite a type only when you need one
  3. 3Union types and narrowingTypeScriptA value with more than one type
  4. 4Object interfacesTypeScriptName an object's shape once
  5. 5Type aliasesTypeScriptNaming and combining types
  6. 6Optional and readonly fieldsTypeScriptWhat may be missing and what never changes
  7. 7Literal typesTypeScriptA fixed set of values
  8. 8Arrays and tuplesTypeScriptA fixed length, and the original array stays put
  9. 9Function typesTypeScriptPassing functions and optional parameters
  10. 10The unknown type instead of anyTypeScriptCheck a value before you use it