Is the JS sandbox safe to run untrusted code?+
The sandbox runs in an isolated iframe with restricted access. It cannot access your browser's localStorage, cookies, or make cross-origin requests. It's safe for testing your own code, but don't paste code from unknown sources without reviewing it first.
Can I use npm packages in the sandbox?+
You can import packages via CDN URLs using import() syntax: const _ = await import('https://cdn.skypack.dev/lodash'). This loads the package from a CDN rather than npm install.
What is the difference between this and the browser console?+
The browser console exposes your current page's scope and can manipulate the DOM. This sandbox is a clean isolated environment with no page context - better for testing pure logic without side effects on a live page.
Does it support async/await?+
Yes. Top-level await is supported - you can write await fetch(...) directly without wrapping in an async function. This makes testing APIs and async operations much simpler.