Compile a small function from an expression (arrow, anonymous, or wrapped function expression) or from a parameter list + body, then call it with JSON arguments. See the return value, timing, and errors — all evaluated in your browser tab (no server). This is not a security sandbox; use only code you trust.
Must evaluate to a function — for example (x) => x * 2, function (a, b) { return a + b; }, or (function () { return 1; }).
Equivalent to new Function('a', 'b', 'return a + b;') — no outer scope from this page is injected.
Use [] for zero-argument functions. Values are passed positionally to fn.apply(null, args).
A function tester lets you quickly try a small JavaScript function with a chosen set of arguments and inspect the result without creating a file or a full test project. It is useful for debugging arithmetic, array transforms, and pure helpers — the same things you might otherwise type into the browser console.
In Function expression mode, your code is wrapped as new Function('return (' + yourCode + ')')() so the expression must evaluate to a callable function. In
Parameters + body mode, your parameter names and body are passed to new Function directly. Arguments are parsed as JSON and applied with
fn.apply(null, args). Return values are pretty-printed: primitives as text, objects and arrays with JSON.stringify when possible, and a short note if a
Promise is returned (this page does not await).
message and stack in the output area.Code runs in the same page as the tool: it can touch the page DOM, storage, and network APIs if you write that. This is not an isolated sandbox like a VM or a locked-down iframe. Do not paste untrusted code. Infinite loops will freeze the tab until the browser stops the script.
No. Compilation and execution happen in your browser. For confidential logic, still follow your organization’s policies on using web-based tools.
No. The function runs in the same JavaScript realm as the page. It is not suitable for running untrusted or unknown code. Use dedicated VMs or isolated environments for that.
Bare declarations like function f() {} are statements, not expressions. Use an arrow or anonymous function expression that evaluates to a function, or switch
to Parameters + body mode.
async functions return promises. This tool does not await; chain .then() in a console snippet or test async code elsewhere.
No. Paste plain JavaScript that runs in the browser. For modules and TypeScript, use your bundler or a local playground.
Synchronous infinite loops or long blocking work cannot be interrupted from this UI. Keep snippets small and avoid tight loops on large data.
Use JSON in the arguments field — for example [{"x":1}, [2,3]]. JSON does not support undefined, functions, or symbols as values.