Javascript Playground
Paste JavaScript to test whether it parses. The code is checked, never executed.
Paste JavaScript to test whether it parses. The code is checked, never executed.
new Function() but not executedThe 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.
No. It checks syntax only, which makes it safe for untrusted snippets. To run code, use your browser's developer console.
import and export are only allowed in modules, and new Function compiles a normal function body. Remove them to test the rest.
No. Everything happens in your browser.