Variable declaration effects

Benchmark created on


Setup

function incrementLocal() {
	let a = 0;
	a++;
}

function incrementParameter(a) {
	a = 0;
	a++;
}

let definedOutside = 0;
function incrementUpvalue() {
	definedOutside = 0
	definedOutside++;
}

Test runner

Ready to run.

Testing in
TestOps/sec
Local variable
incrementLocal()
ready
Parameter as local
incrementParameter(0)
ready
Closure up-value
incrementUpvalue()
ready

Revisions

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