Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
array.includes vs if &&
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0
Browser:
Firefox 124
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
if &&
1467357312.0 Ops/sec
Array.includes
48510156.0 Ops/sec
Tests:
if &&
const foo = 'foo'; if (foo !== 'bar' && foo !== 'baz') { return 0; } return 1;
Array.includes
const foo = 'foo'; return ['bar', 'baz'].includes(foo) ? 1 : 0;