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!
JS is a "High Level" Programming Language
JS is an "Interpreted" Language
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.
Everyone learns at different rates. A lot of things influence this!
How Much Time Do You Have?
Sure it will. My cousin worked two jobs with a child and only had an hour a day to code. Took him 17 months but she’s working as a Frontend dev— BrainFatigueX (@fatigue_x) October 2, 2021
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?
Last week, I got my FIRST part-time job as a junior web developer.— Juan Alvarez 🏞️ (@Juanzenweb) September 6, 2021
It took me:
📅 4 months
💼 3 Interviews
💻 A lot of coding and projects
📚 Learning A LOT!
My history, how I got to this point, and what I'm doing forwards. 👇🏻
If you are a junior: take notes! 🤗
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"?
What's your learning process?
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.
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.
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.
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
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!
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!
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.
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!
Join 2,000+ readers and learn something new every month!