ProgrammingBeginnerTypeScript

TypeScript Fundamentals

Add a static type system to JavaScript: annotations, inference, interfaces, unions, narrowing and generics.

TypeScript is JavaScript with a type system that runs before your code does. Instead of discovering that a value was undefined three screens away, the compiler tells you at the point you made the mistake. This course builds that foundation from first principles: what types are, how TypeScript infers them when you say nothing, how to describe the shape of your data with interfaces, how to model alternatives with unions, how narrowing turns a union into a precise type, and how generics let one function work for many types without falling back to any. By the end you will be able to read a typed codebase without guessing, and you will write functions that are hard to misuse.

4.6 (120) 900 students 56 min 6 lessons 150 XP on completion

What you will be able to do

  • Explain what a static type system does and when it pays for itself
  • Write type annotations and rely on inference where it is clearer not to
  • Model object shapes with interfaces and optional properties
  • Represent alternatives with union types and narrow them safely
  • Write generic functions that preserve type information
  • Recognise the traps that quietly destroy type safety: any, assertions and non-null assertions

Assessments

Dashboard