JavaScript / TypeScript Playground

JS & TS Engine

Execute modern JavaScript (ES2024) and TypeScript code in a secure in-browser sandboxed thread. Live console logging, execution timings, and zero server roundtrips.

JavaScript / TypeScript Code
0 lines · 0 chars JavaScript
Console Logs & Output
Ctrl/Cmd+Shift+C
Press "Run" (⌘↵) to execute code in sandboxed thread.
Ready Console

About This Tool

This runs a single JavaScript/TypeScript-flavored snippet inside an isolated Web Worker and streams its console.log, warn, error output and run time back into a terminal-style panel. It is designed for trying out a data pipeline, an algorithm, or a Web Crypto call without opening browser devtools or scaffolding a project.

Scripts execute strictly in client-side memory with zero server roundtrips.

Key Features

  • Four bundled snippets: Async/Await & Promises, Data Pipelines & Array Methods, Web Crypto API & Hashing, and Algorithms & Benchmarking.
  • Top-level await support: Code runs inside an async function, so you do not need to wrap it yourself.
  • Optional auto-run on edit: Debounced about 400ms after you stop typing.
  • Per-run execution timer: A badge showing elapsed milliseconds for the last run.
  • 5-second runaway timeout: A hung or infinite-looping worker is force-terminated automatically.
  • Worker sandbox isolation: Executes in an isolated Web Worker context, preventing DOM manipulation issues.

Frequently Asked Questions

What happens if my code throws or hangs?
Thrown errors are caught and shown as a red [ERROR] line with the message. Code that never finishes is force-stopped after a 5-second timeout and the worker is terminated.
Does console.log handle objects and multiple arguments?
Yes. Each argument is stringified (objects via JSON.stringify) and joined with a space; console.warn and console.error render in their own colored rows.
Can I use top-level await?
Yes. Your code runs inside an async function, so await works at the top level of the snippet without wrapping it yourself.
What are the four bundled snippets?
Async / Await & Promises, Data Pipelines & Array Methods, Web Crypto API & Hashing, and Algorithms & Benchmarking: pick one from the Snippets dropdown or click Reset Sample to reload the current selection.
Does anything get sent to a server?
No. Code executes in an isolated Web Worker in your browser; nothing is uploaded, and there are zero server round-trips.