You've decided to learn JavaScript because you want to become a Frontend or Backend developer.
But how do you start? Which road to take to learn JavaScript efficiently, and, if possible, less painful?
In this post I share my experience and principles on how to learn JavaScript fundamentals and stay motivated in the process.
Note: JavaScript fundamentals I consider the keywords, data types, operators, variables, expressions, functions, closures, objects, prototypal inheritance, classes, this
, promises, async/await
.
1. Step by step
Stephen King is one of my favorite writers. He has published around 61 novels. Many of these have been adapted into movies and TV series.
When King was asked in an interview "How do you write?", he answered:
One word at a time.
There are no shortcuts or silver bullets to write a good book: you write one word at a time. He writes a book word by word, minute by minute, hour by hour until it's completed.
Step by step principle applies to learning JavaScript language too. There are no shortcuts or silver bullets on how to learn JavaScript: you need, step by step, to understand each concept of the language.
2. Learn the way you like it
There are plenty of ways to learn JavaScript: by reading books, watching video courses, attending freeCodeCamp.
2.1 Books
My preference is to learn from books. Books let me understand the information in silence, at my own pace, allow me to re-read multiple times what is difficult.
The game-changer for me in understanding JavaScript was reading from cover to cover JavaScript: The Definitive Guide (6th edition). The book teaches in an accessible manner all simple to advanced concepts of JavaScript.
If books are your thing, take the following:
- JavaScript: The Definitive Guide (7th edition)
- Head First JavaScript Programming
- You Don't Know JS Book Series
It's not enough only to read the book. You need a way to retain the information. I use these practices to solidify knowledge while reading.
First, write notes of important ideas in a notebook while reading. That's efficient because when you note the idea, you think more about it and retain better. Repetition is the mother of skill.
A page with notes I had taken when reading "JavaScript: The Definitive Guide":
Second, play with the code snippets you encounter in an online JavaScript editor, for example in jsitor or codesandbox.
2.2 Video courses
Video courses have the benefit of being more interactive than books.
The course author can explain the difficult concepts in a human-understandable way. Plus, guided by the author, you can practice by creating real-world applications.
A list of JavaScript beginner courses to consider:
- Modern JavaScript From The Beginning (by Brad Traversy)
- The Modern Javascript Bootcamp Course (by Colt Steele and Stephen Grider)
2.3 freeCodeCamp
You can also attend to learn JavaScript at freeCodeCamp. Register and choose the course "JavaScript Algorithms and Data Structures Certification".
First, freeCodeCamp is completely free.
Second, the lessons are high quality and at the end of each lesson you can practice exercises to solidify what you've learned.
3. Done is better than perfect
Whatever option you've chosen to learn JavaScript — from a book, video course, or freeCodeCamp — complete it from the start until the end.
It is vital to have a full understanding of JavaScript fundamentals. Having knowledge gaps is always going to slow you down and put into trouble. Half-knowledge is no knowledge.
I know that sometimes, especially around the middle of the book or course, things can become boring. Or you can think that the explained feature isn't needed. Or you might want to skip because it's complicated.
Resists the urge to abandon at the middle, and push yourself to study until the end. It's OK if you don't understand everything, it's OK if you still have questions: done is better than perfect.
4. Don't cherry-pick
Long time I was working as a developer without having a solid understanding of JavaScript. I was cherry-picking information from random posts, Stackoverflow.
Being tired of troubles because of knowledge gaps, I started reading "JavaScript: The Definitive Guide" in detail. After understanding the features of JavaScript I had been having troubles so long, I was blaming myself: why haven't I read this book earlier and avoided all the troubles?
Please don't make my mistake. Don't cherry-pick information about JavaScript fundamentals. Instead, follow a JavaScript fundamentals book or course, and complete it from the start until the end.
5. Pure JavaScript
A specific of Frontend development, where JavaScript is involved, is the abundance of UI libraries and frameworks like React, Vue, Angular.
A lot of beginner developers make the mistake of skipping JavaScript fundamentals, and jump into using a UI library like React.
No UI library or framework is going to compensate the poor knowledge of JavaScript. If you're bad at JavaScript — you're bad at React.
Do deliberately learn pure JavaScript fundamentals first.
6. Tricks to stay motivated
Saying is easier than doing. Here's a list of tricks to stay motivated and increase the efficiency of learning.
6.1 Morning hours are the most productive
The morning hours (from 07:00 AM until 12:00 AM) are the most productive in learning.
If you have the possibility, get up early morning, and commit to learning JavaScript during this timeframe.
6.2 End the lesson on the most interesting moment
Sometimes, after a few dozens of chapters or lessons, you may find difficult to motivate yourself to continue learning.
I overcome this by finishing the current session on the most interesting part. This way I have the interest to start next time.
7. Summary
Are you ready to become a JavaScript developer? Find your book or course, and get started today!
What's your favorite book or course to learn JavaScript?