Рет қаралды 39,673
Your default attitude towards return types should be 'don't use them', unless one of three things are true:
- You're writing a function with multiple branches
- You're building a library
- You have a specific TS perf concern and you're banging your head against the wall
Become a TypeScript Wizard with Matt's free TypeScript Course:
www.totaltypescript.com/tutor...
Follow Matt on Twitter
/ mattpocockuk
00:00 What is a return type?
00:49 Should you use them?
01:08 Multiple branches in functions
02:32 Library code
03:10 Performance