TypeScript Course || 6 Type Narrowing Techniques

Опубликовано: 31 Октябрь 2024
на канале: tapaScript by Tapas Adhikary
543
36

Learn about Narrowing(Type Narrowing) from this video. We will discuss 6 ways to achieve Type Narrowing in TypeScript, with plenty of examples.

1) Narrowing: The "typeof" guard
2) Narrowing: With "Equality" operator
3) Narrowing: With "in" operator
4) Narrowing: The "instanceof" guard
5) Narrowing: With "Type Predicate" Function
6) Narrowing: "Discriminated Unions"

Not only that, we will also learn the elaborative use cases of concepts like Type Predicates and Discriminated Unions.

Welcome to 'TypeScript With tapaScript". Here is the fifth video to help you to get started with TypeScript. I hope you are liking the TypeScript course, and enjoy going through it.

I take special care to provide you the best quality. Please SUBSCRIBE to the channel to show your support. Also, could you like/comment on this video so that it reaches others? Thanks! 🫶

Support My Work: https://github.com/sponsors/atapas

Timecodes
0:00 - Introduction to Narrowing
00:20- Type Narrowing
03:30 - Narrowing Techniques
04:52 - Narrowing: The "typeof" guard
07:05 - Narrowing: typeof and truthiness
11:27 - Narrowing: With "Equality" operator
14:16 - Narrowing: With "in" operator
16:31 - Narrowing: The "instanceof" guard
22:12 - Type Predicate
25:59 - Narrowing: With "Type Predicate" Function
27:05 - Type Predicate use case
32:17 - Discriminated Unions
34:25 - Type Discriminant
35:33 - Narrowing: "Discriminated Unions"
37:54 - The End Notes

Follow tapaScript on GitHub
https://github.com/tapascript

Join tapaScript Discord
tapaScript Discord Link:   / discord  

Source Code Repository:
https://github.com/tapascript/ts-gyan...

The Prototype Video:
   • Prototypes In JavaScript & Object Cre...  

🤝 My Links:
Blog: https://blog.greenroots.info/
Follow on X(Twitter):   / tapasadhikary  
Connect on LinkedIn:   / tapasadhikary  
Follow My Work on GitHub: https://github.com/atapas
Follow on Facebook:   / tapasadhi  

👋 Like my work? Thank You. You can sponsor me from here:
Sponsor Me: https://github.com/sponsors/atapas
Sponsor my Blog: https://blog.greenroots.info/sponsor

About Me:
Tapas Adhikary is an Educator at tapaScript, Tech enthusiast, Writer, YouTuber, and Open Source projects maintainer/contributor. He is a full-stack developer who has vast experience in building SaaS solutions. He is the founder of the ReactPlay platform, which is driven by open-source projects and a fast-growing community.

You can find more about him at https://tapasadhikary.com.

#typescript
#typescriptdevelopment
#typescripttutorial
#learntypescript
#typescriptcourse
#javascript
#softwaredeveloper
#softwaredevelopment
#webdevelopment
#webdeveloper