Lesson 3.1

Conditional types and infer

A conditional type branches on assignability, and infer pulls a type out of the branch it matched. This is how utility types are built.

14mIntermediate15,256 students
Video thumbnail for Conditional types and infer

Sign in to watch this lesson

Browsing is free. Create an account to play videos and track your progress.

Overview

A conditional type branches on assignability, and infer pulls a type out of the branch it matched. This is how utility types are built.

What this lesson covers

  • Branch a type on an extends check
  • Extract inner types with infer
  • Understand distribution over union members

This lesson sits in Advanced Types, part of TypeScript for Application Developers. It assumes what came before it and leads directly into the next lesson in the module.

In this lesson you will:

  • Branch a type on an extends check
  • Extract inner types with infer
  • Understand distribution over union members
Conditional types and infer — Skiply