JS Playground
Try it live
Pick a target below, then press Run (or Ctrl+Enter). Your code runs locally in your browser — nothing is uploaded anywhere.
Tips
-
Every JavaScript snippet in the lessons has a Run in playground button — it loads the code here in the right mode automatically.
-
Canvas mode gives you
ctx(a 2D drawing context),WandH(640 × 360), plusclear()to wipe and redraw. -
Page mode gives you
page(the dashed stage box above) — create elements, move them withMath.cos/Math.sin. -
Both modes give you
print()(writes to the output panel) andloop(fn)(callsfn(t)every animation frame; starting a new run stops the old one). -
Errors appear in the output panel — read them, they are part of the lesson.
Next: Project: Analog Clock — Unit 5 turns this playground into full projects.