Best Way to Learn JavaScript if You Already Know How to Code

If you already have experience with Python, Lua, C++, or any other programming language, and you're looking to start learning JavaScript, you might find that most resources available are geared towards beginners who are picking up JavaScript as their first language.

Here's how you can effectively learn JavaScript if you already have coding experience:

If you just need to get something done in JavaScript and don't particularly care about it beyond that, you should check out examples that are similar to what you are trying to accomplish and reference those. If something goes wrong or doesn't act the way you are expecting, look it up in the docs as it comes up.

If you actually want to learn JavaScript, you should check out the Wikipedia page of JavaScript to see how it's different from the language you already know.

  • Paradigms: You should see what programming styles JavaScript supports, like functional, imperative, object-oriented, etc. Find out which one is preferred in JavaScript.

  • Typing: Learn about how JavaScript handles types. Is it dynamic or static? Does it check types during compiling or while running the program? Check if it has features like sum types, option types, or type inference.

  • Values: See if everything in JavaScript is considered a value or an object, and if they are mutable or immutable.

  • Evaluation: Find out if JavaScript evaluates expressions lazily (like Haskell) or eagerly.

  • Modules: Check if JavaScript has a way to organize code into modules or namespaces, or if it's more like file-based organization.

  • Compilation: See if JavaScript needs to be compiled before running, and if so, what it compiles to (native code or to a virtual machine).

  • Late-binding: Find out if you can change functions or objects while the program is running.

  • Scope: Learn about how JavaScript handles scope, if it has lexical scope, global scope, or supports closures.

  • Memory management: See if JavaScript requires manual memory management like C, or if it uses automatic garbage collection like Java, or something else entirely.

  • Syntax: See if JavaScript's syntax is similar to the language you already know.

This will give you a precise picture of what you'll need to learn JavaScript. If you find out that the differences for "going to JavaScript" are small, you can then open this guide and give it a quick read, it will be far easier for you now that you know how JavaScript is similar and how it differs.

If the thing that JavaScript supports is completely foreign to you, for example, you dont' really have any familiarity with asyncronous programming, then you need to read about it. These unknown topics will be the biggest stumbling block for learning JavaScript

Next, it will also help you to find a well-written library in JavaScript that implements something you know how to implement in language you already know, and read the code carefully.

Try to understand what idiomatic code for JavaScript is, how things are better done in JavaScript.

Then just go and build something with JavaScript to get hands-on experience and use documentation whenever you get stuck. You can also use resources like Practice JS which has a series of exercises to practice.

And lastly, avoid the mistake of just translating code from another language directly into JavaScript. Instead, try to understand and write code that's suited for 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.