includes vs comparison

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
includes
const a = '1';
const b = '2';

if ([a,b].includes('2')) {
	console.log(1);
}
ready
comparison
const a = '1';
const b = '2';

if (a === '2' || b === '2') {
	console.log(1);
}
ready

Revisions

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