Skip to content
🔷

TypeScript Basics

50 lessons

Add type safety to JavaScript — interfaces, generics, utility types, and advanced patterns.

  1. 1

    TypeScript Overview

    What TypeScript is, why it adds types to JavaScript, and how it catches errors before runtime.

  2. 2

    TypeScript vs JavaScript

    How TypeScript differs from JavaScript: static types, compile-time checks, and tooling.

  3. 3

    Basic Types in TypeScript

    The primitive types in TypeScript: string, number, boolean, array, tuple, enum, and more.

  4. 4

    Type Annotations and Inference

    How to write explicit type annotations and when to rely on TypeScript's type inference.

  5. 5

    Interfaces in TypeScript

    How to define object shapes with interfaces, extend them, and use them with classes.

  6. 6

    Type Aliases in TypeScript

    How to create named type aliases for primitives, unions, objects, and function signatures.

  7. 7

    Union and Intersection Types

    Combine types with unions (A | B) and intersections (A & B) for flexible type modeling.

  8. 8

    Enums in TypeScript

    Define named constant sets with numeric and string enums, and when to prefer alternatives.

  9. 9

    Typing Functions in TypeScript

    Type function parameters, return values, optional and rest params, and function overloads.

  10. 10

    Generics in TypeScript

    Write reusable, type-safe functions and types using generic type parameters.

  11. 11

    Arrays and Tuples in TypeScript

    Type arrays with element types and tuples with fixed-length, position-typed arrays.

  12. 12

    Object Types in TypeScript

    Describe object shapes with inline types, interfaces, index signatures, and Record.

  13. 13

    Type Narrowing in TypeScript

    How TypeScript refines union types inside conditional branches using type guards.

  14. 14

    Custom Type Guards in TypeScript

    Write user-defined type guard functions with the 'x is Type' predicate for custom narrowing.

  15. 15

    Null and Undefined in TypeScript

    Handle null and undefined safely with strictNullChecks, union types, and definite assignment.

  16. 16

    Optional Chaining in TypeScript

    Safely access nested properties with the ?. operator without runtime errors.

  17. 17

    Nullish Coalescing in TypeScript

    Provide default values with the ?? operator, which only triggers on null and undefined.

  18. 18

    Utility Types in TypeScript

    Built-in type transformations: Partial, Required, Pick, Omit, Record, Readonly, and more.

  19. 19

    Mapped Types in TypeScript

    Transform existing types by mapping over their keys with custom modifiers and filters.

  20. 20

    Conditional Types in TypeScript

    Branch types at compile time with T extends U ? X : Y and the infer keyword.

  21. 21

    Modules in TypeScript

    Organize code with ES modules: import, export, default exports, and re-exports.

  22. 22

    Namespaces in TypeScript

    Organize code with namespaces (internal modules) and understand when to prefer ES modules.

  23. 23

    Declaration Files (.d.ts)

    Describe JavaScript libraries with .d.ts declaration files and the declare keyword.

  24. 24

    The tsconfig.json Configuration

    Configure the TypeScript compiler with tsconfig.json: target, strict, paths, and more.

  25. 25

    Type Inference in TypeScript

    How TypeScript infers types automatically and the rules governing inference contexts.

  26. 26

    Advanced Generic Patterns

    Master advanced generics: constraints, defaults, variadic tuples, and recursive types.

  27. 27

    Decorators in TypeScript

    Use decorators to annotate and modify classes, methods, properties, and parameters.

  28. 28

    Mixins in TypeScript

    Compose class behavior from multiple sources using the mixin pattern instead of inheritance.

  29. 29

    Strict Mode in TypeScript

    Enable strict compiler flags to catch the most bugs: null checks, implicit any, and more.

  30. 30

    TypeScript Best Practices

    Production-ready TypeScript practices: naming, typing, error handling, and project structure.

  31. 31

    Conditional Types

    A comprehensive guide to Conditional Types in TypeScript, covering core concepts, implementation details, and practical examples.

  32. 32

    Mapped Types

    A comprehensive guide to Mapped Types in TypeScript, covering core concepts, implementation details, and practical examples.

  33. 33

    Template Literal Types

    A comprehensive guide to Template Literal Types in TypeScript, covering core concepts, implementation details, and practical examples.

  34. 34

    Type Inference Deep Dive

    A comprehensive guide to Type Inference Deep Dive in TypeScript, covering core concepts, implementation details, and practical examples.

  35. 35

    Type Narrowing Techniques

    A comprehensive guide to Type Narrowing Techniques in TypeScript, covering core concepts, implementation details, and practical examples.

  36. 36

    Discriminated Unions

    A comprehensive guide to Discriminated Unions in TypeScript, covering core concepts, implementation details, and practical examples.

  37. 37

    Function Overloads

    A comprehensive guide to Function Overloads in TypeScript, covering core concepts, implementation details, and practical examples.

  38. 38

    Generic Constraints

    A comprehensive guide to Generic Constraints in TypeScript, covering core concepts, implementation details, and practical examples.

  39. 39

    Utility Types Built-in

    A comprehensive guide to Utility Types Built-in in TypeScript, covering core concepts, implementation details, and practical examples.

  40. 40

    Custom Type Guards

    A comprehensive guide to Custom Type Guards in TypeScript, covering core concepts, implementation details, and practical examples.

  41. 41

    Declaration Files

    A comprehensive guide to Declaration Files in TypeScript, covering core concepts, implementation details, and practical examples.

  42. 42

    Module Augmentation

    A comprehensive guide to Module Augmentation in TypeScript, covering core concepts, implementation details, and practical examples.

  43. 43

    Variance and Type Compatibility

    A comprehensive guide to Variance and Type Compatibility in TypeScript, covering core concepts, implementation details, and practical examples.

  44. 44

    Covariance and Contravariance

    A comprehensive guide to Covariance and Contravariance in TypeScript, covering core concepts, implementation details, and practical examples.

  45. 45

    Recursive Types

    A comprehensive guide to Recursive Types in TypeScript, covering core concepts, implementation details, and practical examples.

  46. 46

    Branded Types

    A comprehensive guide to Branded Types in TypeScript, covering core concepts, implementation details, and practical examples.

  47. 47

    Phantom Types

    A comprehensive guide to Phantom Types in TypeScript, covering core concepts, implementation details, and practical examples.

  48. 48

    Type-Level Programming

    A comprehensive guide to Type-Level Programming in TypeScript, covering core concepts, implementation details, and practical examples.

  49. 49

    Strict Mode Options

    A comprehensive guide to Strict Mode Options in TypeScript, covering core concepts, implementation details, and practical examples.

  50. 50

    TypeScript Compiler API

    A comprehensive guide to TypeScript Compiler API in TypeScript, covering core concepts, implementation details, and practical examples.

Completed: 0 / 500%

Learning Stages

Est. total: 14h 25m
  1. 1

    Foundation

    13 lessons · 2h 10m

    Build a solid foundation with the essential concepts and syntax.

    0/13
  2. Core

    13 lessons · 3h 15m

    Deepen your understanding with core patterns and common use cases.

    0/13
  3. Intermediate

    12 lessons · 4h

    Tackle intermediate topics and start combining concepts fluently.

    0/12
  4. Advanced

    12 lessons · 5h

    Master advanced techniques and apply them to real-world problems.

    0/12

Completion Standard

Complete 80% lessons, 60% exercises, and 50% projects to master this topic.

Overall0%
  • Lessons0 / 200%
  • Exercises0 / 1000%
  • Projects0 / 100%

Skill Assessment

0 / 20 mastered
0 mastered0 in progress20 not started
  • Basic TypesFoundation
    0 / 5 lessons · 0%
  • Interfaces & Type AliasesCore
    0 / 5 lessons · 0%
  • GenericsIntermediate
    0 / 3 lessons · 0%
  • Type Narrowing & GuardsCore
    0 / 6 lessons · 0%
  • Utility TypesIntermediate
    0 / 3 lessons · 0%
  • Advanced TypesAdvanced
    0 / 4 lessons · 0%
  • TypeScript ConfigurationCore
    0 / 5 lessons · 0%
  • TypeScript PatternsAdvanced
    0 / 5 lessons · 0%

+12 more skills

Recommended next: typescript-overview
20 remaining

Build real projects

Apply what you learned by building guided projects with starter code and solutions.

View projects

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors