// Transpiles down to support IE(lol)varadd=function(first,second){returnfirst+second;}
There are libraries that does type validations.
TypeScript is good if I'm building a complex and large scale JavaScript Applications. But for a small apps, I'll use JSDoc and manually put input validation to ensure I got those values correctly.
I agree with the result of transpilation of TS, it does not give a high quality code, not to mention how it does the handling of numbers. It is a big problem not to worry about which is the true code that V8 will receive
Just add Babel into compilation process. TypeScript's compiler is not so great at generating code for the browser, especially if you use some newer features.
Whether it is static or strongly typed, it transpiles down to javascript. which would be a horror if there are no type validations or null checking.
to
There are libraries that does type validations.
TypeScript is good if I'm building a complex and large scale JavaScript Applications. But for a small apps, I'll use JSDoc and manually put input validation to ensure I got those values correctly.
I agree with the result of transpilation of TS, it does not give a high quality code, not to mention how it does the handling of numbers. It is a big problem not to worry about which is the true code that V8 will receive
Just add Babel into compilation process. TypeScript's compiler is not so great at generating code for the browser, especially if you use some newer features.
Regarding type validation, I often use class-validator.
Sure, if you're working on something small TypeScript may be like pulling Howitzer from the garage to go to the grocery store.
Perhaps you could discuss this with FP Peeps 🤷🏻♂️ for the class-validator. They don't use classes but use Interface(abstract class).