Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.includes vs Logic or
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Browser:
Chrome 141
Operating system:
Windows
Device Platform:
Desktop
Date tested:
6 months ago
Test name
Executions per second
Array Length = 2
30832716.0 Ops/sec
Array Length = 5
17242952.0 Ops/sec
Or Length = 2
186958384.0 Ops/sec
Or Length = 5
202735216.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const testCase1 = 'c'; const testCase2 = 'abc'; const testCase3 = 'test'; const testCase4 = 'abcdefghijklmn';
Tests:
Array Length = 2
['a', 'b'].includes(testCase1); ['a', 'b'].includes(testCase2); ['a', 'b'].includes(testCase3); ['a', 'b'].includes(testCase4);
Array Length = 5
['a', 'b', 'c', 'd', 'abc'].includes(testCase1); ['a', 'b', 'c', 'd', 'abc'].includes(testCase2); ['a', 'b', 'c', 'd', 'abc'].includes(testCase3); ['a', 'b', 'c', 'd', 'abc'].includes(testCase4);
Or Length = 2
testCase1 === 'a' || testCase1 === 'b'; testCase2 === 'a' || testCase2 === 'b'; testCase3 === 'a' || testCase3 === 'b'; testCase4 === 'a' || testCase4 === 'b';
Or Length = 5
testCase1 === 'a' || testCase1 === 'b' || testCase1 === 'c' || testCase1 === 'd' || testCase1 === 'abc'; testCase2 === 'a' || testCase2 === 'b' || testCase2 === 'c' || testCase2 === 'd' || testCase2 === 'abc'; testCase3 === 'a' || testCase3 === 'b' || testCase3 === 'c' || testCase3 === 'd' || testCase3 === 'abc'; testCase4 === 'a' || testCase4 === 'b' || testCase4 === 'c' || testCase4 === 'd' || testCase4 === 'abc';