LANG TS · 2 credits
Course Outline
TypeScript
TypeScript is JavaScript with a type system on top, and it is the default language of professional web development today. Building directly on both JavaScript courses, you will annotate variables and functions, shape data with interfaces and unions, narrow types safely, write generics from first principles, apply the built-in utility types to API data, and configure and migrate real projects. Every new idea is shown as JavaScript first, then the TypeScript version side by side.
What you will learn
- ✓Annotate variables, function parameters, and return values so the compiler catches bugs before the code runs
- ✓Model real data with interfaces, type aliases, optional and readonly properties, and literal types
- ✓Use union types and narrowing (typeof, in, discriminated unions) to handle data that can take several shapes
- ✓Write and read generic functions, generic interfaces, and constraints without guessing
- ✓Apply built-in utility types like Partial, Pick, Omit, and Record to real API-shaped data
- ✓Set up tsconfig, migrate a JavaScript file to TypeScript, and decode the most common compiler errors
- ✓Handle missing values safely: string | null unions, optional chaining ?., nullish coalescing ??, and tuples for fixed-position data
Course outline
Unit 1Why Types
- 1-1What TypeScript Is2 checks · 9 min
- 1-2Annotating Variables3 checks · 10 min
- 1-3Annotating Functions4 checks · 11 min
Unit 2Core Types
- 2-1Typed Arrays3 checks · 9 min
- 2-2Typed Objects4 checks · 11 min
- 2-3Literal Types, any, and unknown4 checks · 12 min
- 2-4Tuples: Arrays with Fixed Positions3 checks · 10 min
Unit 3Interfaces and Type Aliases
- 3-1Naming Shapes with Interfaces3 checks · 10 min
- 3-2Optional and Readonly Properties3 checks · 11 min
- 3-3Extending Shapes, and type vs interface4 checks · 12 min
Unit 4Union Types and Narrowing
- 4-1Union Types3 checks · 9 min
- 4-2Narrowing with typeof and in2 checks · 11 min
- 4-3Discriminated Unions4 checks · 13 min
- 4-4null, undefined, and Optional Access4 checks · 11 min
Unit 5Functions Typed Well
- 5-1Optional and Default Parameters4 checks · 11 min
- 5-2Typing Callbacks3 checks · 11 min
- 5-3void, never, and Overloads4 checks · 12 min
Unit 6Generics
- 6-1Your First Generic Function3 checks · 11 min
- 6-2Generic Interfaces and Types3 checks · 10 min
- 6-3Constraints: extends for Type Parameters4 checks · 11 min
Unit 7Utility Types and Real Patterns
- 7-1Partial, Pick, and Omit3 checks · 11 min
- 7-2keyof and Record4 checks · 11 min
- 7-3Typing API Data3 checks · 13 min
Unit 8TypeScript in Practice
- 8-1tsconfig Essentials and strict Mode3 checks · 11 min
- 8-2Migrating a JavaScript File3 checks · 11 min
- 8-3Decoding Compiler Errors5 checks · 12 min
Practice while you learn
Use Hack University's public online code editor when you want to run code online before committing to the full curriculum. The browser compilers are free for quick syntax checks, exercises, and interview practice in an isolated sandbox environment.