Can I learn JavaScript in a couple of weeks? How long it does it take to get to an advanced level?
Whether you’re looking to become a frontend developer, or simply to dabble in a bit of code, these might be 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 JS 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:
- An introduction to JavaScript and frameworks
- How to get started with learning JavaScript
- The importance of learning Vanilla JavaScript
- Final thoughts
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 engine to execute it.
JavaScript frameworks are collections of JavaScript code libraries that provide pre-written JS 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 mucking about in code for a while, you’ve likely heard of them. If you want to learn more about these in general, then check out our beginner’s guide to web frameworks.
Now, how to kick off your JavaScript journey?
2. Getting started with JavaScript
To start learning this or any other programming 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: JS 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, you place two slashes “//” in front of the code or text you wish to have the JS 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.
To help you along, we created a free 5-day coding course which gets you building exactly this—your own interactive website, with HTML, CSS, and JavaScript.
Get a sneak-peek at one of the JavaScript tutorials, as Abhi shows you the ropes:
When it comes to playing around with JavaScript code, try to solve problems for topics you’re good at.
If, for example, you’re good at math, create a calculator app. If you’re good at marketing, create a landing page for lead generation. The main goal is solving a real-world problem.
3. The important of learning Vanilla JavaScript
First things first—an important note.
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 JS 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 coding purchase: 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 such as package managers like npm. 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. Final thoughts
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.
This approach definitely works—our graduates are the proof. Before taking the CareerFoundry Full-Stack Web Development Program, Julio was trying to study by himself:
I did a lot of self-studying, which involved a lot of guesswork from tutorials. When I started trying to do my own thing, I found myself wondering: ‘What if there is another way of doing this, and I’m doing it the wrong way?’
So having one-on-one support from a tutor and mentor at CareerFoundry—actual programmers with experience, was great. Having someone look at my code and say ‘Yes, it’s right’ gave me a huge feeling of relief, knowing that I was doing it right.
After graduating, Julio worked with his career specialist and created a high-quality JavaScript developer job application, which soon landed him not one but three job offers! So it can definitely be done.
If you’d like to learn more about becoming a frontend developer, check out these guides:
- What Does It Take To Become A Web Developer? Everything You Need To Know Before Getting Started
- An Introduction To ES6 And Its Successors: What’s So Great About The Latest Versions Of JavaScript?
- The 7 Essential Tools For Frontend Web Development
- A Guide To Landing Your First Job As A Junior Web Developer