Update variable in outer scope vs function argument

Benchmark created on


Setup

let x = 0;

function f1() {
	x++;
}

function f2(arg) {
    let x = arg;
    arg++;
    return arg;
}

Test runner

Ready to run.

Testing in
TestOps/sec
Outer scope
f1()
ready
Function argument
x = f2(x)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.