DEV Community

Discussion on: Using Custom Types in JavaScript Docs

4lch4 profile image
Devin W. Leaman Author

I've thought of using TypeScript for a while but am not too fond of having to learn a new language just for better intellisense/type information.

Is there a good resource you'd recommend to learn more about how to use it?

anurbol profile image
Nurbol Alpysbayev • Edited on

The beauty of Typescript is that it is designed with the "any Javascript is a Typescript" principle in mind. This means, that you can learn it gradually. You can simply rename an extension of your file from .js to .ts and add a first type you need. e.g.:

myJsFunction(youAlwaysForgetTheExactTypeOfThisArgument: number) {

And this was how I learned it: needed to describe a type, just tried to select a correct type intuitively first. If no success, then go to
And of course, google, which in 95% cases directs you to the links listed above or to stackoverflow or sometimes: