Lab // Code

Code Studio

42 language packs, 46 named-lib cheat sheets (not imported), runnable patterns — and a JavaScript sandbox that actually runs. Other languages are honest cheat sheets, not fake interpreters.

JavaScript

Multi: prototype, functional, evented

This lab's sandbox. Browsers, Node, and this Code Studio.

This one executes in the sandbox below.

Cheat

  • let / const — block scope. var is function scope (avoid).
  • === strict equality. == coerces (avoid).
  • Array: map, filter, reduce, find, some, every, slice.
  • Object: {a: 1}. Access obj.a or obj['a'].
  • async: Promise, then, async/await. fetch exists in browsers, not in this sandbox.
  • JSON.parse / JSON.stringify for data shapes.
  • Template strings: `n=${n}`

Stdlib / core

Math · JSON · Array · String · Number · Date · Object.keys · Map / Set

Pitfalls

  • this sandbox has no fetch, no DOM, no require, no parent window.
  • Floating point: 0.1 + 0.2 !== 0.3. Use integers for money.
  • typeof null === 'object' is a language fossil.
function greet(name) {
  return "hello " + name;
}
print(greet("lab"));
Ready.

Runs in a sandboxed iframe in this browser. No network. Output is not experimental evidence unless you independently verify it.