Secret weapon how to promote your YouTube channel
Get Free YouTube Subscribers, Views and Likes

Better error handling with unknown type in TypeScript

Follow
TypeScript TV with Benny

Improve your error handling in catch clauses by using TypeScript's unknown type.

My FREE programming apps:
https://apps.apple.com/app/id659282498
https://play.google.com/store/apps/de...

My FREE TypeScript Course:
https://typescript.tv/'>https://typescript.tv/

Timeline:
00:00 Typing errors in trycatch
01:35 Type Guard Definition
01:55 instanceof Type Guard
02:17 Handle custom errors
04:30 typeof Type Guard
05:26 in Type Guard
06:36 Custom Type Guard
09:41 any vs. unknown
10:01 Compiler option for unknown

Code:
➜ https://gist.github.com/bennycode/92c...

Resources:
https://typescript.tv/'>https://typescript.tv/errors/
➜ https://www.typescriptlang.org/tsconf...

Follow TypeScript TV:
https://typescript.tv
  / typescripttv  
   / typescripttv​  

Hashtags:
#TypeScript #JavaScript #Programming

posted by CORRELxa