Should You Learn JavaScript or Switch to TypeScript?

If you are just starting to learn JavaScript, you might be considering beginning your learning journey in the most effective way. One idea could be to start directly with TypeScript instead of JavaScript.

Or, if you already have basic knowledge of JavaScript, you might think about switching to TypeScript instead of diving deeper into JavaScript.

TypeScript is a superset of JavaScript. The issue is that most resources teaching TypeScript focus exclusively on features unique to TypeScript, assuming you already know JavaScript. As a result, you won't learn much JavaScript from these resources except for some basic concepts like the syntax of for loops, which are used to demonstrate how the type system works in real code.

Moreover, TypeScript can become very complex, and the deeper you dive into it, the less it resembles JavaScript. It can essentially become an entirely different language layered on top of JavaScript.

In summary, it will be challenging to learn JavaScript from TypeScript because most TypeScript resources assume prior JavaScript knowledge. Ideally, a course that teaches both JavaScript and TypeScript simultaneously, without assuming any prior JavaScript knowledge and only covering TypeScript at a superficial level, would be best for learning both languages. However, I'm not sure if such a course exists.

Therefore, I recommend learning JavaScript first. Understand programming concepts, and learn how to build simple (or advanced) projects. Then, you can read the TypeScript documentation to see if you'd like to add a type system to your JavaScript.

Badge

100%
FREE

10 Tips to Stay Motivated While Learning JavaScript

  • You've decided to learn JavaScript.
  • You quickly sign up for the Odin Project or register at FreeCodeCamp.
  • You sit down and start going through the material.
  • Over the next few weeks, you fall into a pattern of studying.
  • You start getting confused by some of the concepts, and there isn't anyone to ask for help.
  • After a few months, you realize you aren't anywhere near landing a new job.
  • You decide to take a break because you're feeling burned out and exhausted.
  • That break stretches on indefinitely.

Sounds familiar?

When you're learning to code by yourself, you have to generate your own motivation.

These 10 tips will change your life.