Javascript Playground

Paste JavaScript to test whether it parses. The code is checked, never executed.

What you can do here

How the JavaScript tester works

The code is handed to the browser's own JavaScript engine with new Function(code), which compiles it without running it. If it compiles, you see "Valid JavaScript"; if not, you get the engine's error message, such as Unexpected token '}'. Because nothing is executed, it is safe to test an unfamiliar snippet here.

Common questions

Does this playground run my code?

No. It checks syntax only, which makes it safe for untrusted snippets. To run code, use your browser's developer console.

Why is valid ES module code reported as an error?

import and export are only allowed in modules, and new Function compiles a normal function body. Remove them to test the rest.

Is my code uploaded?

No. Everything happens in your browser.