College

Async code, classes, modules and real projects. Four grades, Freshman to Senior Year, with twelve lessons in all.

Start learning

Everyone starts in Kiddie School and works up to here, one grade at a time.

Freshman Year

Asynchronous JavaScript

Three lessons, then a test against Buggsy.

What you’ll learn

  • Synchronous code runs line by line, waiting for each. Asynchronous code starts a slow task and carries on.
  • setTimeout(fn, ms) runs fn once later; setInterval(fn, ms) repeats until clearInterval(id).
  • Callbacks inside callbacks become the pyramid of doom.
  • A Promise is an IOU for a future value: pending, then fulfilled or rejected. Use .then, .catch, .finally.
  • async functions always return a promise; await pauses until a promise settles. Handle errors with try…catch.
  • Promise.all([…]) runs things in parallel and waits for all of them.
  • const res = await fetch(url); const data = await res.json(); and check res.ok!
  • The event loop: synchronous code first, then promise callbacks (microtasks), then timers.

The lessons

  1. Timers and callbacks Synchronous vs asynchronous, setTimeout, setInterval and the pyramid of doom.
  2. Promises, async and await An IOU for a future value, and code that reads like a story.
  3. Parallel, fetch and the event loop Promise.all, getting data from the internet, and how it all works.

Read the Freshman Year course notes

Sophomore Year

Classes and objects

Three lessons, then a test against Buggsy.

What you’ll learn

  • A class is a blueprint; new ClassName() builds an instance. constructor sets it up.
  • instanceof checks which class made an object.
  • get and set make properties that run code. static belongs to the class itself.
  • #private fields can only be used inside the class.
  • class Dog extends Animal inherits; super(…) calls the parent’s constructor or methods.
  • this rules: a method call uses the object before the dot; new makes a new object; a plain call is undefined; arrows borrow this from outside.
  • Classes are a nicer way to write prototypes, which is what JavaScript uses under the hood.

The lessons

  1. Your first class Blueprints, constructors, methods and instanceof.
  2. Getters, statics, privates and inheritance Smarter properties, class-wide data, secrets and family trees.
  3. The mystery of this The four rules of this, bind, and prototypes under the hood.

Read the Sophomore Year course notes

Junior Year

Modules, Node.js and tools

Three lessons, then a test against Buggsy.

What you’ll learn

  • Modules split code into files. export shares; import brings things in.
  • Named exports: export function add() {} → import { add } from "./math.js". Default: export default App → import App from "./app.js".
  • In the browser: <script type="module" src="main.js">.
  • Node.js runs JavaScript outside the browser: node app.js.
  • node:fs/promises reads and writes files; process.argv holds command-line arguments.
  • npm installs packages. package.json lists them; node_modules holds them (don’t share it); npm run runs scripts.
  • Tests check your code automatically. Git saves your history; linters and formatters keep code tidy.

The lessons

  1. Modules Split your code into files with export and import.
  2. Node.js: JavaScript everywhere Run JavaScript on your computer, read files and take arguments.
  3. npm, tests and the pro toolbox Packages, scripts, automatic tests, Git and friends.

Read the Junior Year course notes

Senior Year

Building real apps

Three lessons.

What you’ll learn

  • Plan first: what should the app do? Sketch the screens, list the data, then build in small steps.
  • The state + render pattern: keep all important data in variables (the state), write a render() that draws the page from it, and after every change, update the state and call render() again.
  • Keep logic in small, testable functions that don’t touch the page.
  • Save the state with localStorage so it survives a reload.
  • You know enough JavaScript to build real apps: to-do lists, quizzes, weather apps, games. Go build!

The lessons

  1. Planning a project How professionals turn an idea into an app, step by step.
  2. Project: Tasky, the to-do list Add, finish, delete and filter tasks, with logic you can test.
  3. Projects: quiz show and weather app Game logic, fetching live data, and where to go next.

Read the Senior Year course notes

Class starts whenever you’re ready

Every lesson is free, there’s nothing to sign up for, and your progress saves as you go.

Start learning