JavaScript From Zero
Learn JavaScript from nothing to genuinely advanced: where it runs, values and types, collections, control flow, modules, async and the DOM - then the deep half: scope and closures, this and prototypes, generators, the event loop, functional JS, bundlers, performance, and the road to TypeScript. Small, runnable steps, clear explanations.
Download EPUB- Install & Your First Program JavaScript runs in two different places - the browser console and Node.js. Install Node, check the version, run a hello.js file, and try the browser console; learn why the two runtimes are not the same.
- Syntax, Values & Types How to name values with let and const (and why not var), the primitive types (string, number, boolean, null, undefined), template literals, and what dynamic, loose typing means - including the == vs === trap, NaN, and floating-point money.
- Collections - Arrays & Objects Arrays are ordered lists with powerful methods like map, filter, and reduce; objects are labeled key/value bundles; Map and Set exist for special cases. Plus the reference-vs-value rule that explains why two equal-looking arrays aren't equal.
- Control Flow & Functions Make decisions with if/else, repeat with for/of and while, and package reusable behavior in functions - declarations, arrow functions, parameters and defaults. Functions are values you can pass around, and a first look at why 'this' is tricky.
- Modules & Project Layout Split code across files with ES modules (import/export), understand what package.json and node_modules are, and learn a sane small project layout - the foundation you'll build the async work in Phase 6 on top of.
- Async & the DOM - JavaScript's Big Idea JavaScript runs on a single thread with an event loop, so slow work (network, timers) is handled asynchronously - callbacks gave way to Promises and then async/await; in the browser, JS reads and changes a live tree called the DOM and reacts to events.
- Errors & I/O - When Things Go Wrong and Data Comes In Handle failures with try/catch/finally and throw, catch rejected Promises by wrapping await in try/catch, and read the outside world the way each runtime does it: fetch in the browser, fs in Node - with JSON parsing in both.
- The Ecosystem & Tooling - npm, Runtimes, and the Tools Everyone Uses npm installs packages and runs package.json scripts; JavaScript runs in two worlds (browser and Node, with Deno/Bun as newer runtimes); Vite bundles for the browser, Prettier formats, ESLint lints, and Vitest/Jest run your tests.
- Idioms & Common Gotchas - Write It Like a Local, Dodge the Traps Modern JS idioms - destructuring, spread/rest, optional chaining, nullish coalescing, array methods over loops, modules over globals - plus a cheat-card for the classic traps: == vs ===, this, hoisting, NaN, floating point, shared references, and truthy/falsy surprises.
- Scope, Closures & Hoisting - How JavaScript Remembers What scope actually is, how a variable lookup walks the scope chain, why var leaks and let/const don't, hoisting and the temporal dead zone, and the headline idea - closures: functions that remember where they were born.
- this, Prototypes & the Object Model - How Objects Really Work Go deep on the parts of JavaScript that confuse everyone: how this is decided by the call, what call/apply/bind do, why arrow functions are different, the prototype chain, and why classes are just sugar over it.
- Iterators, Generators & Symbols - Producing Values on Demand What for...of really does, why the protocol hangs off a Symbol, how to make your own objects iterable, and how generators let one function pause, resume, and stream values lazily - even infinitely.
- The Event Loop, Deep - Tasks, Microtasks & Why Order Surprises You JavaScript runs on one thread, so 'async' means deferred, not parallel. Here's the runtime model: the call stack, microtask vs macrotask queues, the drain-everything rule, and why a Promise always beats setTimeout(0).
- Functional JavaScript - Functions as Building Blocks Treat functions as values you pass around and combine. Pure functions, immutability, higher-order functions, and composition - the small set of ideas that make JavaScript code testable, predictable, and easy to reason about.
- Modules & Bundlers, Deep - From Files to a Shippable App ESM vs CommonJS and why static imports matter, what a bundler actually does to your import graph, how tree-shaking drops dead code, and using dynamic import() to split heavy code into chunks loaded on demand.
- Performance & Memory - How V8 Runs Your Code How V8's JIT turns hot JavaScript into fast machine code, why consistent object shapes matter, why algorithmic cost beats micro-optimizing, how garbage collection reclaims memory, and how leaks still sneak in.
- Types & the Road to TypeScript - Catching Bugs Before They Run Why dynamic typing lets type bugs slip to runtime, what static typing buys you, how TypeScript layers types onto plain JS, the no-build JSDoc on-ramp, and where to go next.
- Where to Go Next - Straight Signposts From Here You know the language; here's the clear map of what's next - frontend frameworks (React/Vue/Svelte), backend with Node/Express, TypeScript (typed JS, strongly worth it), full-stack - plus what to actually build to make it stick.