Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Stop Writing TypeScript Code Like This

27.7K views on YouTube

*Master TypeScript utility types* with my *FREE TS Util Types Cheat Sheet* – _18+ types_ 👉 https://webdevsimplified.com/ts-utility-types-cheat-sheet.html
*Become a senior TypeScript developer* with my *Full TypeScript Course* – _50+ videos, 10+ hours+_ 👉 https://courses.webdevsimplified.com/typescript-simplified/?utm_source=youtube&utm_medium=video-description&utm_term=video-id-63m2vvB4wo4

One of the best features of TypeScript is its inference, but that inference can also be a negative. In this video I talk all about why you may want to use explicit return types in TypeScript since it can solve many common typing issues and in some cases is even required by TypeScript.

📚 Materials/References:

FREE TS Utility Types Cheat Sheet: https://webdevsimplified.com/ts-utility-types-cheat-sheet.html
TypeScript Simplified Course: https://courses.webdevsimplified.com/typescript-simplified/?utm_source=youtube&utm_medium=video-description&utm_term=video-id-63m2vvB4wo4

🌎 Find Me Here:

My Blog: https://blog.webdevsimplified.com/
My Courses: https://courses.webdevsimplified.com/
Patreon: https://www.patreon.com/WebDevSimplified
Twitter: https://twitter.com/DevSimplified
Discord: https://discord.gg/7StTjnR
GitHub: https://github.com/WebDevSimplified
CodePen: https://codepen.io/WebDevSimplified

⏱️ Timestamps:

00:00 – Introduction
00:46 – Recursive functions
01:32 – Catching errors
04:01 – When to use vs not use return types
07:00 – Optionally very useful return types

#TSReturnTypes #WDS #TypeScript