Typescript is a really powerful language due to the fact that it is superset of JavaScript. It allows you to do things with types that you cant do in other strongly typed languages like Java or C#. Learning JavaScript first, you would have an easier time grasping advanced typescript concepts. But like others said, JavaScript does allow you to learn bad habits. It takes years to learn how to write JavaScript in a way where you won’t shoot yourself in the foot. TypeScript first would theoretically help keep you on a learning path that would mitigate picking up bad habits. But typescript is a superset of JavaScript after all. If one is determined to sidestep all the nice typings that TypeScript provides you, one can and you will lose all the benefits of TypeScript anyways.
Knowing Typescript is enough to begin and start a career, you are sure to pick up relevant vanilla JS knowledge along the way. There is no way around JS: you'll see it in tooling, debugging, building etc.
Of course you can really focus and grok everything way in advance, but I would argue it's not necessary.
You're better off first learning Typescript. It's the only one of the two I'd consider a "programming" language.
Due to the strict nature of TS, you'll quickly learn the correct practices of Javascript, and moving from TS to JS is super easy.
If you learn Javascript instead, you'll likely run into a lot of issues moving to Typescript, due to how much slack it gives. Incorrect types, incorrect this, incorrect classes, incorrect invocations, incorrect references, unused variables, etc.
Edit: What makes learning JS even worse is the bad habits you learn. Humans, especially adults, really struggle to get rid of bad habits. It makes life miserable until you get rid of them.
Typescript, IMHO, is superior in every way and shoyld be your primary focus to learn.
I've had interviews that still expect you to know the inner workings of JS, though, so it's a good idea to get a deeper understanding of how the two relate.
In my experience, Typescript lets me think significantly less hard because I’m not having to “compile” the types in my head all the time. I think even with no Javascript experience I’d recommend starting with Typescript.
Programming
All things programming and coding related. Subcommunity of Technology.
This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.