About this tool
Run JavaScript in a browser worker. Inspect console.log output, exceptions and asynchronous function results next to your code.
How to use it
Enter a program and press Run. Use console.log() for intermediate values or return for the final result. Await asynchronous work that should complete before execution ends.
Practical example
Try return [2, 4, 6].map(n => n ** 2) to see the array of squares. Add console.table() to inspect objects.
Frequently asked questions
Where can I test code that uses document?
The DOM is available in the HTML editor preview. Here, code runs in a Web Worker with network access disabled.
How do I stop an infinite loop?
Press Stop to halt the run and keep the code in the editor. Each new run gets a separate worker.