DEV Community

Discussion on: Why You Should Use Typescript Over Javascript?

Collapse
 
shreyanshsheth profile image
Shreyansh sheth

any is only useful when you are stuck in something that does not have type defs and also when you are working with some javascript library that does not have any types. also note that i wrote starting out with loose typescript configuration and make it strict along the way.

Thread Thread
 
haaxor1689 profile image
Maroš Beťko

Not even for that. You shouldn't use any at all and use unknown and never instead. I've used any as an example for someone who doesn't really want to use typescript.

Thread Thread
 
shreyanshsheth profile image
Shreyansh sheth

i 100% agree that any is the troublemaker and we should be using never & unknown.