JavaScript · console included
Bare JavaScript,
no boilerplate.
Paste a function, a loop, a fetch experiment or a whole script. CodeRush builds the document around it, runs it in a sandboxed frame, and collects every log, warning and error with the line it came from.
- No HTML wrapper needed
- Console with a command line
- Known libraries from cdnjs
Paste a script, get a page
The same path a complete page takes.
Plain JavaScript needs somewhere to run, so the pad generates a minimal document and puts your script in it. Everything a script expects is there — document, window, timers, events — and anything it writes to the DOM appears in the preview.
const ideas = ['what if', 'why not', 'go on'];
const pick = ideas[Math.floor(Math.random() * ideas.length)];
document.body.textContent = pick + '?';
document.body.style.font = '400 14vw Georgia, serif';
document.body.style.color = '#2545ED';
ideas.forEach(function (idea, index) { console.log(index + 1, idea); });
Open the Console drawer after it runs: the three numbered lines are waiting there.
The console is a tool, not a log dump
Filters, sources and a prompt of its own.
Logs, warnings and errors are captured with their source location, filtered by type, and cleared when you want a fresh run. An uncaught error does not disappear into the void — it is shown with the line that threw, and the preview stays on screen so you can see what did render.
The drawer also has a command line. It evaluates against the current preview, awaits promises, and recalls what you typed with the arrow keys, so you can poke at a running sketch instead of adding another console.log and running it again. History stays in that tab.
Problems goes the other way: it parses the source locally, without running it, and reports syntax errors and common accessibility gaps by line. Nothing executes and nothing leaves the tab to get that answer.
Libraries, loops and the exits
What happens when a script misbehaves.
A bare script that reaches for a well-known library — the kind of answer a chat gives you — gets it from cdnjs at a pinned version, and the pad says which one it is loading. Nothing else is fetched on your behalf, and a script that asks for another host pauses for consent first.
Inline loops are instrumented with a three-second budget that resets every time the event loop yields, so a button you click ten minutes later still gets a full budget while an accidental infinite loop gets stopped. Stop replaces the frame and ends its timers and requests; Run offline re-renders with no scripts at all.
TypeScript is one paste away on the TypeScript playground, and JSX compiles in the tab on the React playground.
Questions
- Do I have to wrap my JavaScript in HTML?
- No. Paste the script on its own and CodeRush generates the document around it before running it.
- Where do console.log lines go?
- Into the Console drawer, with their type and source location. The drawer also has a command line that evaluates inside the current preview.
- Can I use a library such as three.js or p5?
- If your script references a library CodeRush knows, it is loaded from cdnjs at a pinned version and the pad tells you. You can also add your own script tag in an HTML page.
- What stops an infinite loop from freezing the tab?
- Inline loops get a three-second budget that resets on every yield, and Stop replaces the preview outright.