Few Tips to prevent runtime errors in Typescript
#1 Prefer unknown over any
See this example on how any could go wrong.
const a: any = "dhslkd"
a.someMethod() // Runtime Error: a.someMethod is not a function
Oops! a does not have the someMethod but typescript doesn't care.
Let's try the same but ...
arunmurugan.hashnode.dev2 min read