run.liter8.sh
Predict the state before you press run.
A real JavaScript interpreter in your browser, with the heap, the scope chain and the call stack on the page beside the program. You say what it will do. Then it does it, and shows you exactly where you and the machine parted company.
Before you scroll: what is in config.tags now?
const config = { retries: 2, tags: [] };
function withDefaults(options) {
const merged = { ...config, ...options };
merged.tags.push("default");
return merged;
}
const a = withDefaults({ retries: 5 });
const b = withDefaults({});Two calls, neither of which mentions config. This gym is for the gap between the answer you just gave and the one the machine has.
Nine tracks
- 01Values and bindingsWhat a name holds, and what it only points at.
- 02Hoisting, scope and the dead zoneThe scan that runs before the code does.
- 03The stackA call is a frame; a return is a frame popping.
- 04Objects, references and mutationOne object, and every name that reaches it.
- 05ClosuresA function that carried its scope with it.
- 06`this` and prototypesFour call forms, four answers, and a lookup that walks.
- 07Control and failureWhere a throw goes, and what a `finally` can overrule.
- 08The event loopThe synchronous run first, and all of it.
- 09Reading what was generatedA function a model wrote, read before it runs.
Start at the beginning · free, local-first, no account. Nothing you do here leaves this browser.