2 ms·
JavaScript has type annotations, they're called Typescript. And this doesn't seem to be sold as an automated way to convert JS code to TS (which would be reall
by IshKebab 4y ago
JavaScript has type annotations, they're called Typescript.
And this doesn't seem to be sold as an automated way to convert JS code to TS (which would be really useful). It seems like they intend for you to stick to pure JS code which makes no sense really.
> at some point it would 'blow up your face' anyway
I'm not sure exactly what you're saying but yes you do need to annotate the types of functions. Global type inference is possible but it has performance issues, makes type errors way harder to debug and obscures the intent of code. Types are a part of your interface. They should be stated, not inferred.
I would rather things didn't blow my face up.