DEV Community

Discussion on: TypeScript?.. or JavaScript?

 
dotintegral profile image
Artur Siery • Edited

JS Hinting is great, but it can only go as far as to the code/objects that you explicitly define. There is no way (unless I missed something) for VS Code to predict the structure of data incoming from API. With TS, you can just state that you expect data of this structure and hinting will work correctly. Granted, there is still possibility that you made mistake in typing the response, or the response changes after some time, but the same problems would occur in normal JS.