False boolean check

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Not
function isOdd(v) {
	return (v & 1) > 0;
}

let count = 0;
for (let i = 0; i < 100000; i++) {
	if (!isOdd(i)) count++;
}
ready
===
function isOdd(v) {
	return (v & 1) > 0;
}

let count = 0;
for (let i = 0; i < 100000; i++) {
	if (isOdd(i) === false) count++;
}
ready

Revisions

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