Don’t use explicit return types, unless...

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: Follow Matt on Twitter 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 ... #MattPocock #typescript #web_development #advanced_typescript 20230201 nwSe95uFN8E
Back to Top