A web developer looking at code on a computer screen

How Long Does It Take To Learn JavaScript? Advice From A Senior Developer

Marven Jose

Can I learn JavaScript in a couple of weeks?

How long it does it take to get to an advanced level?

If you are looking to become a frontend developer, or simply to dabble in a bit of code, these might be two of the first questions that pop into your mind.

Like many other topics in programming, there is no single right answer to these questions. However, JavaScript is a relatively easy programming language. So, the amount of time needed to learn JavaScript is directly tied to the amount of time you are willing to invest in learning it.

Today, we’ll go over a few strategies to get you started on your path to becoming a fantastic frontend developer. I’ll also attempt to give you a realistic idea of how long it takes to learn a new programming language.

I’ve divided this guide into the following sections:

  1. An introduction to JavaScript and frameworks
  2. How to get started with learning JavaScript
  3. The importance of learning Vanilla JavaScript
  4. Wrap-up and final words

So, how long does it take to learn JavaScript? Let’s find out!

1. JavaScript and frameworks

Along with HTML and CSS, JavaScript is one of the three cornerstone technologies of the web. HTML structures the page, CSS styles it, and JavaScript adds interactivity. The vast majority of websites use JavaScript, and major web browsers have a dedicated JavaScript engine to execute it.

JavaScript frameworks are collections of JavaScript code libraries that provide pre-written JavaScript code ready to use for routine programming features and tasks. They expedite the development process, and they do a good job of separating responsibilities in the code. There are plenty of frameworks, including Angular, React, Vue, and MeteorJS. If you’ve been dabbling in code for a while, you’ve likely heard of them.

2. Getting Started With JavaScript

To start learning JavaScript, or any other language, it’s essential to understand the syntax of the language first. Learn what the following are:

  • Variable Declaration: JavaScript variables are containers for storing data values.
     
  • Statements: JavaScript statements are “instructions” to be “executed” by the web browser.
     
  • Keywords: Keywords are tokens that have special meaning in JavaScript: break, case, catch, continue, debugger, default, delete, do, else, finally, for, function, if, in, instanceof, new, return, switch, this, throw, try, typeof, var, void, while, and with.
     
  • Comments: To create a single line comment in JavaScript, you place two slashes “//” in front of the code or text you wish to have the JavaScript interpreter ignore.
     
  • Functions: Functions are one of the fundamental building blocks in JavaScript. A function is a JavaScript procedure—a set of statements that performs a task or calculates a value.
     
  • Objects: In JavaScript, just as in many other programming languages, objects can be compared to objects in real life. All JavaScript values, except primitives, are objects.

Once you’re familiar with these, try building something! Write a “hello world” webpage or create a contact form to submit basic information. Both of these exercises will help you appreciate the big picture and put newly acquired skills to use.

Try to solve problems for topics you’re good at. If, for example, you are good at math, create a calculator app. If you are good at marketing, create a landing page for lead generation. The main goal is solving a real-world problem.

3. Forget frameworks (for now!): Start with Vanilla JavaScript


Frameworks are important, but…

Don’t start off trying to learn a framework. Don’t get me wrong, it’s not that you shouldn’t learn them—they do wonders for developers all over! However, your time will be better spent making sure you are proficient in HTML, CSS, and JavaScript. These foundational web development languages are the building blocks of every JS framework around. Learning them will make it easier for you to learn about frameworks and harness all the awesomeness they provide.

Many individuals who start off learning JavaScript within a framework have a hard time shifting gears. This is largely because what they know of HTML, CSS, and JavaScript comes from the context of the particular framework. If, however, you start outside of frameworks, you can jump into any framework and start figuring out how to work with them once you’ve got JavaScript covered.

More problems arise for those who learn JavaScript via frameworks when the time comes to update. JavaScript within a framework is subject to frequent updates that can make everything you know about that framework irrelevant. Angular has changed so drastically over the past few years that Angular 1.x has almost nothing in common with Angular 6. Libraries and tools come and go, but your capabilities and the skills you develop are here to stay.

Don’t waste your time

When I was a young frontend developer making websites for small and medium enterprises, jQuery was the best! All websites and animations were made with jQuery. If you didn’t use it, your website was old and didn’t offer much to the user. Naturally, developers who knew it made more money than those who didn’t.

So, I made my very first purchase from Amazon: a book titled jQuery in Action. This book taught me everything about the jQuery world, from selecting an element from the DOM to creating complex AJAX calls to REST APIs. I felt like I was a ninja in the coding arts. But guess what? jQuery was replaced by HTML5 and ES2015 and modern browsers’ support of a new set of native APIs that soon will render jQuery useless.

The moral of the story is: invest 80% of your time in learning fundamentals like clean code, design patterns, domain-driven design, and object-oriented architecture. Like frameworks, technologies come and go, but these fundamentals will remain. What you learn will be portable across companies, teams, and domains, and your knowledge will be less likely to be rendered irrelevant.

What about the other 20% of my time? Leave it for frameworks, libraries, and tools. Be smart about it: the longer a technology is on the market, the safer the investment it is. Don’t rush to learn new technology—we don’t know its lifespan. Let time show you which technology is worth investing in. Time is your best advisor. Learn to wait.

4. How long does it take to learn JavaScript? Final words

There is no set time frame for learning JavaScript; it all depends on your level of experience and how much time you can spare. However, with the tips and strategies set out in this guide, you can streamline your approach to learning this key programming language.

Goal-setting can be a powerful tool to help you make headway on your path towards learning JavaScript. Set goals around exercises, like creating a simple landing page, to help you practice and move forward. This will help you stay on track and, shared with the right person, can help you stay accountable.

Build your exercises around real-world problems to gain an understanding of the language and its applications. Be patient and don’t give up! Learning any new skill takes time and dedication.

If you’d like to learn more about becoming a frontend developer, check out these guides:

What You Should Do Now

  1. If you’d like a step-by-step intro to find out if web dev is right for you - sign up here for our free 7-day web dev short course.
  2. If you are interested in becoming a Web Developer check out our web development course (you'll learn the essential skills employers need).
  3. If you’d like to speak to an expert Career Advisor for free about how you can really get a new job in tech - connect with us here.

If you enjoyed this article then so will your friends, why not share it...

Marven Jose

Marven Jose

Contributer to the CareerFoundry Blog

Marven is a front and backend developer and CTO at iguama.com. He loves coding, coffee, and the gym. When he’s not coding, Marven can be found planning the next adventure with his kids.