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.

Runtimes

Node / Deno / Bun / edge2009 – today

JavaScript is no longer one host. The language spec is shared; the I/O, permissions, and module story are not — and that is where the real differences live.

An engine parses and executes JavaScript. A runtime adds everything the spec deliberately leaves out: timers, I/O, networking, module loading, a process model.

// Nothing here is in the ECMAScript specification:
setTimeout(() => {}, 0);   // host-provided timer
console.log("hi");         // host-provided console
// fetch, fs, process, Deno.*, Bun.* — all host APIs, not language features.

// This is the language:
console.log(typeof Promise, typeof Symbol.asyncIterator, typeof globalThis);
The four hosts side by side
V8Engine only: parser, Ignition interpreter, TurboFan/Maglev JITs, garbage collector. Embedded by Chrome, Node, Deno, Workers.
Node.jsV8 + libuv. CommonJS-first history, unrestricted filesystem and network access, the npm registry as its centre of gravity.
DenoV8 + Tokio. Secure by default — filesystem, network, and env access each need an explicit permission flag. Web APIs first.
BunJavaScriptCore + Zig. Runtime, bundler, test runner, and package manager in one binary; optimised for startup and install speed.

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