r/learnjavascript • u/femio • Sep 27 '23
If I was learning JS in 2023, I would 100% start from scratch with Typescript
Just finished up a work project where I had to work with an internal library written in vanilla JS...and it was the biggest pain in the ass. Even with JSDocs, there was so many issues (and bugs) such as things being undefined, nested data structures that were hard to parse, vague params that slipped through the cracks and more. It slowed down my productivity by at least 50%.
Typescript spoils the hell out of us with how it's basically a very light version of a unit test, documenter, autocompleter, and linter all in one. I think anyone learning JS would have a much easier time if you start straight from TS, just with the basics of primitives and return typing. It'll make your life so much easier.