JavaScript: From Basics to Expert
Four levels, twelve lessons, every example runs in your browser
JavaScript is the only programming language a browser runs, which is how it ended up everywhere else as well: on servers through Node, in build tools, in databases, in editors. Learn it once and you can work at either end of a web application.
Overview
The payoff is that most of the behaviour people work around without understanding has one explanation, usually a short one. A closure, the event loop, and the prototype chain account for a surprising share of the bugs in front-end code.
Introduction
No previous JavaScript is assumed, though you will move faster if you have written HTML. If you already use the language at work, Level 1 and Level 2 are the vocabulary you probably have; Level 3 and Level 4 are the parts that explain the behaviour you have worked around without ever being told why it happens.
Three lessons and a Level Check quiz per level, then an Expert Exam. Every example is complete and runnable: press Try yourself and it opens in the compiler, where you edit on the left and watch what it logs on the right. It runs in your browser, so there is nothing to install and nothing is sent to a server.
Every lesson ships a complete, runnable example. Press the "Try yourself!" button under any of them and it opens in the compiler, where you write on the left and see what it logs on the right. It runs in your browser, not on a server.
By the end you will be able to read the JavaScript in any codebase and know what it is doing: why a value captured in a closure changed, what order your callbacks will run in, how a framework intercepts a property access, and when a generator is the simple answer rather than the clever one.
What you will be able to do
- Predict what a piece of JavaScript will do before you run it
- Reach for the right array method instead of a for loop
- Explain what a closure is, and use one on purpose
- Write async code that handles failure as carefully as success
- Read the event loop well enough to explain why order surprised you
- Use generators and proxies where they genuinely earn their place
What each level covers
4 levels · 16 lessons
-
Level 1 - Basic
The ground floor, and the three things that cause most early confusion. Values and types covers the two equalities and why one of them is almost always the one you want; functions and scope covers hoisting, let against var, and what this refers to; and the last lesson is arrays and objects, out of which everything else in the language is built.
4 lessons 36 min of reading
Start with Values and Types → -
Level 2 - Intermediate
The vocabulary you will actually type. The array methods lesson is map, filter, reduce and the ones people reimplement by hand because nobody showed them; destructuring and spread are how modern code moves data about; and classes and prototypes explain what the class keyword is standing in front of.
4 lessons 42 min of reading
Start with The Array Methods You Will Actually Use → -
Level 3 - Advanced
Where the language stops being obvious and starts being powerful. Closures explain the captured variable, the counter that keeps counting and the loop that logged the wrong number; promises and async/await cover the error handling people get wrong; and modules are how any of it is split across files without a global.
4 lessons 46 min of reading
Start with Closures → -
Level 4 - Expert
The machinery underneath. The event loop lesson answers what runs when, including the difference between a microtask and a timer; iterators and generators show how for...of works and how to make your own lazy sequence; and the last lesson covers the symbols and proxies that frameworks are built on.
4 lessons 56 min of reading
Start with The Event Loop →
Guides and articles
Longer reading about this subject, written alongside the course.
Before you start
- You can write basic HTML
- No previous JavaScript required
Common questions
- What does the JavaScript: From Basics to Expert course cover?
- It is 4 levels and 16 lessons: Level 1 - Basic; Level 2 - Intermediate; Level 3 - Advanced; Level 4 - Expert. Each level ends with a quiz, and the last one is an exam over the whole course.
- How long does it take?
- About 180 minutes of reading and exercises - roughly 3 hours. It is self-paced with no cohort and no start date, so you can leave and come back and the site remembers where you were.
- What do I need to know first?
- You can write basic HTML. No previous JavaScript required.
- Is it free?
- Yes. Every lesson, example and quiz in this course is free to read, and you do not need an account to read them. Signing in only adds progress tracking and quiz results.
- What will I be able to do afterwards?
- Predict what a piece of JavaScript will do before you run it. Reach for the right array method instead of a for loop. Explain what a closure is, and use one on purpose. Write async code that handles failure as carefully as success. Read the event loop well enough to explain why order surprised you. Use generators and proxies where they genuinely earn their place.