Conditional set variable vs unconditional set variable

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Conditional set
let foo;

for (let i = 0; i < 10000; i++) {
	if (!foo) foo = 1;	
}
ready
Unconditional set
let foo;

for (let i = 0; i < 10000; i++) {
	foo = 1;	
}
ready

Revisions

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