re: How TypeScript squashed all known bugs VIEW POST

re: I still confused, for example, I create a method like this; function aTypeScriptMethod(age: number) { } And backend data returns like that; ...

TypeScript does not do anything in this case. TypeScript only checks types at compile time while the types of the response from the backend is known only at run time. There are some tools/libraries that allow you to use TypeScript types at runtime like:


That's really interesting. I'm honestly not sure how I feel about that type of a library as it's not just a simple transpile down to JavaScript, but the injection of runtime type checking. I'll have to think more about that but I have a pretty strong gut negative for whatever reason. Thanks for sharing the library. I learned something new there.

code of conduct - report abuse