It typically takes 6-12 months to go from a complete beginner to a fairly decent level in JavaScript. At least, that's what the general consensus on the internet seems to be.

As a very rough, ballpark estimate, that 6-12 month range isn't too long. If you put in a lot of effort, within 6-12 months you'll learn JavaScript well enough to build basic apps - and probably start applying for junior dev roles.

However, the truth is a little more complicated! In reality, there's only one true answer to "How long does it take to learn JavaScript":

It depends!

OK, probably not the answer you wanted! That's why I gave you that 6-12 month ballpark figure up-front. If you wanted a number, you've got one. If you want to learn a bit more about what learning JS actually means, and how to speed the process up a bit, read on!

Is JavaScript Easy To Learn?

JavaScript is one of the easier programming languages to learn, mainly because it's high level, interpreted, and weakly typed. Here's what I mean by that...

JS is a "High Level" Programming Language

This basically means it's closer to the language you speak than it is to the language that computers speak (known as machine code, or assembly language). This makes JavaScript easier to learn than languages like C, which are a little closer to the hardware.

JS is an "Interpreted" Language

JS is "interpreted" - that means the code you type is the code the browser reads and runs. Other languages are "compiled", meaning the code must be compiled into a form that computers understand, which requires extra software and time. (Java is a good example - see Java vs JavaScript - main differences for more info).

For JavaScript, all you need is a text editor and a browser - and you already have these!

JavaScript is Weakly Typed

In programming, you define variables. These variables can be different types - integers, decimals, text strings, etc. In strongly typed languages, you have to specify what type every variable is - and once defined, it usually cannot change type. In JS, which is weakly typed, you don't! Again, this makes JS more flexible, and easier to learn in the early stages.

Everybody learns JavaScript at a different rate

One thing I don't like about questions like "How long does it take to learn JavaScript" (or C, Ruby, PHP, or whatever), is that they put pressure on people. They make it seem like you should learn JS in a set time frame, and if you don't hit that target, you're doing something wrong.

Not true!

Everyone learns at different rates. A lot of things influence this!

How Much Time Do You Have?

When you ask "How long" it takes to learn JS, you could mean one of two things - how long in calendar time (e.g. 6-12 months), or how long in study time, (e.g., 1000 hours)?

What really matters here, of course, is study time. If you have a full-time job and 7 kids, you won't be able to put as much study time in per month. So for you, it might take 18 months, or longer, to get where you want to be. And that's OK! You might have done the same amount of study time as someone who got there in 3 months but had loads of free time.

What's Your Experience in Coding/Maths/Computer Science?

Your background will matter a lot too. If you're already employed as a C# developer, you'll probably pick up JavaScript in a few weeks. This is because all programming languages are pretty similar, so you'll have a lot of transferable skills.

If you did computer science at university, you'll also have a bigger headstart than if you did classical history, as you'll have done some work in programming, and you'll understand computing concepts more broadly. Mathematics would also give you an advantage.

Likewise, if you already have some skills in HTML and CSS, you'll pick up JS more quickly, since JS directly interacts with the elements you create in these languages.

What Do You Mean By "Learn"?

When you say you want to "learn" JavaScript, what do you mean? I've assumed you mean something like "Be able to build basic apps, and be at the point where you can apply for junior job roles". But if you have higher aspirations, of course it's going to take longer. Conversely, if your goals are less ambitious, it will take you less time.

And really (and I might be getting a bit philosophical here), no one ever reaches the point where they have "learned" JavaScript. Even the true JS wizards are constantly learning and improving - that's part of the reason they got so good in the first place!

What's your learning process?

Getting started meme

One massive factor that's often overlooked, is how you learn. It's not just about putting the hours in, it's about making the most of those hours. Here are a few tips - following these will significantly reduce the time it takes you to get your JS skills to where you want them to be:

Get Some Sleep

Human memory is consolidated while we sleep, so make sure you get a good 7-9 hours of sleep each night. This is especially important if you're coding in the evening on top of a full-time job - the brain needs rest! Reducing caffeine intake, and avoiding caffeine after midday, can make a huge difference.

Spaced Repetition

It's better to practice for 1 hour, 5 times a week than it is to practice for 5 hours, 1 time a week. It's also really helpful to occasionally go back over things you've already learned, to help the knowledge sink in.

Exercise

Physical exercise releases a protein in the brain that helps form new connections between neurons! So try to get 2-3 workouts in each week where you're raising your heart rate and getting a little out of breath, and stay active more generally (e.g. take long walks, use the stairs not the lift, etc.)

Learning at YOUR Own Pace

Don't worry about how fast other people learn or what they are learning. Go at your own pace - if something doesn't make sense to you, put a bit more time into it. There's no rush.

Deliberate Practice

Keep evolving your skills. When you study, try to spend most of your time learning things that you don't know. A guitar analogy might help here. A mistake people often make when learning guitar, is learning a song they love, and then playing it all the time.

Now, there's nothing wrong with that, and if it's fun, then great! But it's not the most efficient way to learn. It would be better to pick another song and challenge yourself in a new way.

Asking Good Questions

Show me the people who learn JavaScript the fastest, and I'll show you some people who ask a lot of questions!

Your first port of call should be Google - 9 times out of 10, someone has already asked your question and gotten an answer. But for those times that Googling doesn't help ask questions on Stack Overflow, or a relevant subreddit.

Remember also, the better your questions, the better the answers will be - so be sure to read How not to suck at asking coding questions!

Doubt meme

Be Consistent

Jerry Seinfeld had a trick to help him learn comedy writing. Every day that he practiced writing, he'd put an "X" on his calendar. He gave himself one goal - Don't break the chain of X's. It didn't matter if he just sat down for two minutes to write - if he wrote anything, he allowed himself to draw the X.

It's so easy to code for a week or two, and then to get busy and forget about it for a month. But if you're coding every day, even for a few minutes, it's easier to maintain the habit long-term.

So be like Jerry Seinfeld - don't break the chain!

Have Fun!

Learning coding is actually a wonderful experience because no one is telling you what to do! So have fun with it! Yes, you'll be spending some time sweating over tutorials and exercises, but try to put at least some time into building something cool - something you want to make.

Should You Learn JavaScript Frameworks?

Another question that comes up is, if you started out by learning jQuery or some other frameworks, have you really learned JavaScript?

When I first started learning JS, I deliberately avoided frameworks, thinking it was best to go "bare metal" and learn to create cool things without relying on other people's code. I think it was the right call, but looking back, I think I would have benefitted from learning frameworks at an earlier stage than I eventually did.

The key, I think, is to learn from frameworks, rather than just simply on them to do the hard work for you.

When you're at a more proficient level, read the frameworks' source code - try to understand how they work "under the hood" (this is something you can do with an interpreted language like JS that you can't do with a compiled language). Once you understand how frameworks work, it actually makes more sense to use them - why re-invent the wheel?

To that end, a great learning exercise is to try to re-create something a framework does, but without using the framework. For example, take fullPage.js. This is a framework that enables you to make glorious full page websites. You can check out some examples of what fullPage.js can do here, and I highly recommend it if you're looking to make a full page site.

However, I also recommend that you try to make a site with full page sections yourself! Then you'll get a grasp of what fullPage.js is actually doing, and how it extends this basic idea into a sleek and unique web browsing experience. When you understand that, go ahead and use the framework!

About the author:

Warren Davies is a front end developer based in the UK.
You can find more from him at https://warrendavies.net