TypeScript: Type Compatibility
Dmytro Danylov
0:00 / 0:00
TypeScript: Type Compatibility
6 932 просмотра · 5 лет назад
Dmytro Danylov
4 тыс. подписчиков
6 932 просмотра · 5 лет назад
In this video I'm going over the Type Compatibility page from the TypeScript handbook. I do my best to explain in detail the topics found on this page: https://www.typescriptlang.org/docs/h....
The code from the video:
https://github.com/d-dmytro/typescrip...
Table of contents:
00:00 Nominal and Structural type systems
00:41 An example of nominal typing
02:52 Structural typing
03:48 What is a sound type system
04:31 An example of structural typing in TypeScript
10:48 Comparing functions
14:48 Function parameter bivariance
19:47 Optional parameters and rest parameters
25:04 Functions with overloads
27:40 Enums
30:00 Classes
32:19 Private and protected members in classes
38:30 Generics
40:36 Subtype vs Assignment compatibility
👨💻 My Udemy Course:
Using TypeScript with React
https://www.udemy.com/course/react-wi...