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- 1Your first typeTypeScriptCatch the bug before the code runs10 min
- 2Type inferenceTypeScriptWrite a type only when you need one10 min
- 3Union types and narrowingTypeScriptA value with more than one type11 min
- 4Object interfacesTypeScriptName an object's shape once11 min
- 5Type aliasesTypeScriptNaming and combining types12 min
- 6Optional and readonly fieldsTypeScriptWhat may be missing and what never changes11 min
- 7Literal typesTypeScriptA fixed set of values10 min
- 8Arrays and tuplesTypeScriptA fixed length, and the original array stays put12 min
- 9Function typesTypeScriptPassing functions and optional parameters12 min
- 10The unknown type instead of anyTypeScriptCheck a value before you use it13 min