JS Code Runner JavaScript
Write, run & visualize how the event loop executes it

Learn JavaScript, one concept at a time

All three declare a variable, but only var and let can be reassigned later — const locks the binding. Watch the Variables panel update as each line runs.

Code

  var a = 1;
  let b = 2;
  const c = 3;
   
  a = 10;
  b = 20;
  console.log(a, b, c);

Controls

Ready Step 0 / 8

 

Press Play or Next to begin.

Call Stack

Functions running right now — the top item is what's executing.

    Variables

    Values captured with watch(name, value).

      Web APIs

      Timers ticking outside the call stack — JS keeps running while these wait.

        Microtask Queue

        .then() callbacks — ALL of these drain before the next macrotask.

          Macrotask Queue

          setTimeout callbacks — the loop runs one per tick, after microtasks drain.

            Console (live)

            (no output yet)