Learn JavaScript
From zero to how the language really works
A free JavaScript course in short animated videos, each with a written explanation. It starts from zero and goes deeper with every lesson: values and types, functions, closures, arrays and objects, the this keyword, classes, prototypes, modern syntax and error handling.
Lessons
Built to be followed in order
8:11Lesson 1
What is JavaScript?
Who JavaScript was built for and why it was written in ten days, why it lets so many mistakes through, why it can't take back its old decisions, and how it reached far beyond the browser.
9:22Lesson 2
JavaScript data types and operators
How a row of zeros and ones becomes a value with a type, what operators do with those values, and why JavaScript says 0.1 + 0.2 isn't 0.3.
9:49Lesson 3
JavaScript basics: variables, conditions, loops and functions
What a program is made of, how it remembers values, makes decisions and repeats itself, what a function is, and why putting a return value on the next line makes the function return undefined.
9:07Lesson 4
JavaScript closures and scope
Three ways to write a function, where a variable lives, how a closure keeps one alive after its function has returned, what a function can do with another function, and why a function that calls itself can run out of stack.
9:52Lesson 5
JavaScript arrays and objects
How arrays hold a list and objects hold values by name, how they nest, why two variables can share one object and a const object can still change, how forEach, map, filter and reduce work through a list with a callback, and why sort puts 10 before 2 until you hand it one.
8:42Lesson 6
The JavaScript this keyword
How a function kept in a property becomes a method, what the word this means inside it (whatever is left of the dot), why a method handed to setTimeout prints undefined, how an arrow function or bind brings the object back, and what it means that arrow functions have no this of their own.
10:03Lesson 7
JavaScript classes and prototypes
How a class works as a blueprint and what new does when it builds an object from one, where methods really live (the prototype, and the chain JavaScript climbs to find them), why two different arrays share a single push, and how extends, super and instanceof follow from that chain.
10:05Lesson 8
JavaScript ES6+ features
The shorter ways modern JavaScript writes everyday code: template literals for strings, destructuring to pull values out of objects and arrays, the three dots of spread and rest (and why a spread copy only goes one level deep), and optional chaining and nullish coalescing for values that might be missing.
9:28Lesson 9
JavaScript error handling
How to read a JavaScript error (its name, its message and the stack trace), how to throw one of your own, how try, catch and finally keep one error from stopping the whole program, and how strict mode turns silent mistakes, like a misspelled variable, into errors.
12:00Lesson 10
Asynchronous JavaScript
Why a timer set to zero milliseconds still runs last: the call stack, the task queue and the event loop. Then callbacks, promises, and async and await, each run through the event loop step by step: callback hell, the microtask queue, promise chains, try and catch with await, and Promise.all.
9:37Lesson 11
JavaScript modules
Why two script files that never mention each other can break each other, and how modules fix it: module scope, export and import, named and default exports, how modules load and run once, live bindings, require and CommonJS in Node, and packages.
9:43Lesson 12
JavaScript iterators and generators
Why a for...of loop walks an array and a string but throws "is not iterable" on a plain object, and how to fix it: the iteration protocol, Symbol.iterator, writing an iterator by hand, generators with function* and yield, spread and destructuring, and Map and Set.
9:34Lesson 13
JavaScript DOM manipulation
What the DOM is and how JavaScript changes a page through it: the tree a browser builds from HTML, document and querySelector, textContent against innerHTML, attributes, querySelectorAll and NodeList, classList, createElement and append, and why a script in the head finds null.
9:53Lesson 14
JavaScript event listeners
How a page reacts to a click or a key: addEventListener and the function you hand it, the event object, event bubbling and event delegation, 'this' and closures in a listener, keydown and input events, and preventDefault for the browser's default actions.
9:37Lesson 15
JavaScript Fetch API
How a page gets data without reloading: the Fetch API and the HTTP request behind it, the promise fetch returns and why the body takes a second await, JSON with JSON.parse and JSON.stringify, sending data with POST, CORS and the same-origin policy, and why a 404 doesn't make fetch fail.
10:46Lesson 16
Cookies vs localStorage vs sessionStorage
The four places a browser keeps a page's data, and where a login token belongs: localStorage and the table of strings behind it, why it needs JSON, sessionStorage for a single tab, IndexedDB for real objects and large data, cookies that travel to the server (document.cookie, Set-Cookie and HttpOnly), and how to choose between them.
11:49Lesson 17
Node.js
What Node.js is: the engine from Chrome with your computer around it in place of a page. The REPL, the process object, the core modules (fs for files, path, streams, and http for a server built from one function), how the event loop and non-blocking I/O let a single thread serve many requests, and installing a package with npm.
9:27Lesson 18
JavaScript build tools
The tools around the language, on one small checkout page: npm scripts that name a project's commands, a test with Node's own test runner, a linter and a formatter, TypeScript's type checker, and a bundler (Vite) that follows every import and writes the one small file the browser gets, with tree shaking, minifying and source maps on the way.
10:02Lesson 19
Build a JavaScript app
The last episode of Learn JavaScript. Build a typing test from an empty folder, with a page, browser storage and a Node server: letters that turn red and green as you type, a timed round, a tested score, a personal best that survives a reload, and a leaderboard every browser shares. Then stop the server in the middle of a round and see what still works.