Deriving Types From Values 15 exercises
explainer

Introduction to Deriving Types in TypeScript

In this section, we'll practice deriving types from other types and runtime values.

TypeScript's tools for transforming types into other types prove incredibly useful.

Instead of repeating yourself every time you declare a type, you can establish single sources of truth for your types. These sourc

Loading explainer

Transcript

00:00 In this section, we're going to be covering deriving types from other types and even from runtime values. TypeScript has a set of tools you can use to basically transform types into other types. And this is super useful because if you think about it, if you had to like repeat yourself every time you wanted to declare a type,

00:20 that would get really, really cumbersome. And it means by using these techniques I'm about to show you that you can have just single sources of truth for your types. That then spread through your application. This is going to make your applications more maintainable, a lot really neater and easier to work with.

00:37 And this is where a lot of the kind of magic of TypeScript really comes to the fore. I can't wait to show you.