JS

runtime.js

One spine: the evolution of JavaScript

Pick an era, expand a concept, and see where it lands in today's runtimes. Every snippet can be dropped straight into the sandboxed console — the event loop panel then shows real, instrumented execution, not a looping animation.

Modern JS

ES2020+2020 – today

Yearly, incremental releases. Small operators that erase enormous amounts of defensive boilerplate, plus top-level await for module-scope asynchrony.

`?.` short-circuits on null/undefined only, and `??` falls back on null/undefined only — unlike `||`, which also swallows 0 and "".

const config = { retries: 0, server: { host: "localhost" } };

console.log(config.server?.port?.toFixed?.(0)); // undefined, no throw
console.log(config.retries || 3);               // 3  — wrong, 0 is valid
console.log(config.retries ?? 3);               // 0  — correct
console.log(config.missing?.deeply?.nested ?? "fallback");

Interview gotchas

15 genuinely tricky, well-known snippets — event-loop ordering, closures in loops, and `this`-binding traps. Open one, read the gotcha, then drop it straight into the sandboxed console to watch it really run.

Event loop
Closures & scope
this binding
Promises & async
Coercion & equality
Built-in traps