Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Codecademy

Learn TypeScript: Type Narrowing

via Codecademy

Overview

Gain insights into the runtime behavior of the TypeScript code by narrowing down union types.

Continue your TypeScript learning journey with Learn TypeScript: Type Narrowing. Leverage TypeScript’s type system to gain insights into the runtime behavior of your code by narrowing down what types unions may actually be.



### Skills you’ll gain
* Understand how TypeScript utilizes type narrowing at runtime.
* Write type guards to check if a variable is a specific type.
* Check if a property exists in an object using the `in` operator.

### Notes on prerequisites
We recommend that you complete [Learn TypeScript: Union Types](https://www.codecademy.com/learn/learn-typescript-union-types) before starting this course.

Syllabus

  • Type Narrowing: Leverage TypeScript’s type system to gain insights into the runtime behavior of your code by narrowing down what union types.
    • Lesson: Type Narrowing
    • Quiz: Type Narrowing
    • Project: Park Service Volunteer Appreciation Program
    • Informational: Next Steps

Taught by

Kenny Lin

Reviews

4.7 rating at Codecademy based on 24 ratings

Start your review of Learn TypeScript: Type Narrowing

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.