array includes vs OR statement

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
5 way or
a = 5

	if(a === 1 || a === 2 || a === 3 || a === 4|| a === 5) {
	console.log('match')
}
ready
array[5]
a = 5

if([1,2,3,4,5].includes(a)) {
	console.log('match')
}
ready

Revisions

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