I have some JavaScript knowledge and lately I’ve been seeing a lot of talk about TypeScript and how amazing it is(I’ve never used it so I’m not sure) is it something I should learn before or after JavaScript? Or do I even really need to learn it
(I would like to do web development)
Learn it after Javascript. All Typescript is is an extension of Javascript to add some static type checking to avoid runtime errors. You don't need to learn it at all, in many cases Javascript is just enough. When you have something that is a little more complex with some messy code you may want to look into Typescript then.
I would like to echo this statement. JavaScript should be the foundation web developers learn. Before react, angular, Vue, Svelte (insert tomorrow’s new framework) and even before TypeScript.
Understanding the fundamentals will make you a better developer in any framework 💪
Thank you, I will keep that in mind.
If you learn Typescript first you will automatically know both. The only difference in getting started is whether or not Type annotations are used. For example:
Of course , later on there's other advantages to use Typescript but that's a different topic.
Know some JavaScript; but consider not only TypeScript, but also something else, like Babel/Flow, Kotlin/JS or Transcypt; or any other variants.
TypeScript is not the only one.
Don't forget to use
// @ts-check
, though.Anyways, having to always write interface in
@typedef
is hell.Have you looked inside the
node_modules
folder?Don't scare him with this folder haha
But yes you need to check :p
Master the fundamentals of JS first. Then search why to use TS. If you feel that TS would be beneficial to you then only learn it. At the end TS code get's compiled to JS only.
JS => Javascript
TS => Typescript
TypeScript has more features and of course types, can be used in the same environments as JavaScript, so no downsides to use it in place of JavaScript except a more complex build pipeline. It adds more compile checks, and better maintainability in the long run, which is something so important for big projects that are going to live long.
Java developpers for instance love TypeScript more than JavaScript for most I've seen. The Deno runtime supports TypeScript natively, Terraform CDK for TS, Github actions in TS, it is going te be first citizen in many techs now.
At the end of the day, if you get used to use types, I personally think you would not go back to JavaScript once you use TypeScript.
JS first, TS later.
Use F# instead: fable.io/repl/ better than both.
Learn Javascript first so that you know what problem TypeScript is trying to solve.
JavaScript first, TypeScript never :P
Js is a good start, basically vanilla js I recommend.