Learn JavaScript by doing. Work through the lessons in order and you'll have solid JS fundamentals — from variables and closures to async/await and the DOM.
Before you start
If you want to practice the exercises in this course on your computer, install VS Code and create a file with a .html extension (for example index.html) that loads a .js file (for example script.js) with a <script> tag, then open the HTML file in your browser and check the console to see your work.
Variables & Scope
Master var, let, and const — how they differ in scoping, hoisting, and reassignment. Learn how block, function, and global scope work in JavaScript.
Data Types
Explore JavaScript's 7 primitive types and objects. Learn typeof, prototypal inheritance, built-in objects like Math and Date, and how JSON serialization works.
Type Casting
Understand implicit coercion — when JavaScript converts types automatically — and explicit casting using Number(), String(), Boolean(), parseInt(), and more.
Data Structures
Work with arrays, Maps, Sets, WeakMaps, and WeakSets. Learn when to use each and the built-in methods that make them powerful.
Operators
Learn all JavaScript operators — arithmetic, assignment, comparison, logical, bitwise, ternary, optional chaining, and nullish coalescing.
Equality Comparisons
Understand == vs === and why they behave differently. Learn Object.is(), the NaN edge case, and when loose equality is actually useful.
Control Flow
Branch your code with if/else and switch. Handle runtime errors gracefully with try/catch/finally, throw, and the built-in Error types.
Loops & Iterations
Loop with for, while, and do...while. Iterate over iterables with for...of and object keys with for...in. Control flow with break and continue.
Functions
Write functions with default params, rest parameters, and arrow syntax. Master closures, lexical scoping, recursion, IIFEs, and the arguments object.
this Keyword
Understand how this changes depending on call site. Learn function borrowing, explicit binding with call, apply, and bind, and why arrow functions behave differently.
Strict Mode
Enable strict mode to catch silent bugs — accidental globals, duplicate parameters, and undeletable properties. Learn why ES modules are always strict.
Modules
Split code across files with ES modules — named exports, default exports, namespace imports, and dynamic import().
Iterators & Generators
Build custom iterables with Symbol.iterator and create lazy sequences with generator functions. Understand how for...of and spread consume iterables.
Classes
Use class syntax for OOP patterns — constructors, instance methods, static members, private fields, getters/setters, and inheritance with extends and super.
Asynchronous JavaScript
Master the event loop, setTimeout, Promises, and async/await. Learn how JavaScript handles concurrency on a single thread and how to avoid callback hell.
Working with APIs
Make HTTP requests with the Fetch API and handle JSON responses. Learn the correct error-checking pattern for async requests.
Debugging
Use console methods effectively, read stack traces, and step through code in the browser's Sources panel. Learn to identify and fix memory leaks and performance issues.