7 days · 20 concepts
JavaScript / Concepts

JavaScript in a week

Twenty concept pages. Modern JS only — no var, no callback hell. By Day 3 you read modern JS fluently; by Day 5 you handle async without thinking; by Day 7 you can pick up TypeScript in an afternoon.


Day 1 · First contact

node, npm, types. Running code in under five minutes.

  1. 01

    Hello, JavaScript

    node, npm, the REPL. Run code three ways in two minutes.

  2. 02

    let, const, types & coercion

    Never var. Always === . The truthy/falsy table that catches everyone.

  3. 03

    Functions

    Function declarations, expressions, arrow functions. The three forms.

Day 2 · Data shapes

Arrays, objects, destructuring. The shapes of every JS program.

  1. 04

    Arrays

    .map, .filter, .reduce. Chain instead of loop.

  2. 05

    Objects

    Literals, destructuring, spread. Object as map.

  3. 06

    Destructuring & spread

    const {a, b} = obj. The pattern that simplifies every function signature.

Day 3 · Flow & equality

Iteration, equality, optional chaining. Modern JS that doesn't hurt.

  1. 07

    Loops & iterators

    for-of for iterables, for-in for object keys, Array.from for sequences.

  2. 08

    The === rule

    Never == . Coercion is a feature, not a bug — but predict it.

  3. 09

    Optional chaining & nullish coalescing

    foo?.bar ?? defaultValue. Modern JS in one line.

Day 4 · Functions & this

Closures, this, classes. The function model.

  1. 10

    Closures & scope

    Functions remember their enclosing scope. The lever behind every callback.

  2. 11

    this binding

    Four rules: new, explicit, implicit, default. Arrow functions opt out.

  3. 12

    Classes

    ES6 classes are syntactic sugar over prototypes. Still useful.

Day 5 · Async

Promises, async/await, the event loop. How JS does concurrency.

  1. 13

    Promises

    A value that arrives later. .then for composition, .catch for errors.

  2. 14

    async / await

    Promises in disguise. Reads like sequential code; runs asynchronously.

  3. 15

    The event loop

    Single thread, queue of tasks. Why "blocking the main thread" matters.

Day 6 · The platforms

Modules, Node, the browser, TypeScript. Where JS runs.

  1. 16

    ES modules vs CommonJS

    import/export now. require() in legacy Node.

  2. 17

    Node basics

    fs, http, process. The Node runtime API.

  3. 18

    The browser DOM

    document, fetch, addEventListener. Vanilla JS in the browser.

Day 7 · Idiomatic JS

The 20 idioms that separate scripting from engineering.

  1. 19

    Error handling

    try / catch / finally. Throw Errors, not strings. Custom classes; cause chains.

  2. 20

    Idiomatic modern JS

    The patterns that separate "knows JS" from "writes JS".