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.

Workers-style runtimes run V8 isolates, not processes. No filesystem, no long-lived globals across requests, and a strictly Web-standard API surface.

// The edge runtime contract, in one handler:
export default {
  async fetch(request) {
    const url = new URL(request.url);
    return new Response(JSON.stringify({ path: url.pathname }), {
      headers: { "content-type": "application/json" },
    });
  },
};
// No fs. No process. Request/Response/URL/fetch — Web APIs only.
The four hosts vs the edge contract
V8The engine underneath most edge runtimes (Cloudflare Workers, Deno Deploy, Vercel Edge) — isolates, not processes.
Node.jsThe opposite end: full filesystem, sockets, and child processes. The edge contract deliberately strips all of that away.
DenoDeno Deploy runs Workers-style isolates; `Deno.serve((req) => new Response(...))` is the same fetch-handler model.
Bun`Bun.serve` also accepts a `fetch` handler, but it runs the full Node API too — a superset of the edge surface.

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