Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
includes vs ||
(version: 0)
Comparing performance of:
['a', 'b'].includes(x) vs 'a' === x || 'b' === x
Created:
2 years ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var x = 'Etali, Primal Storm';
Tests:
['a', 'b'].includes(x)
if (['Moraug, Fury of Akoum', 'Etali, Primal Conqueror'].includes(x)) { // salut }
'a' === x || 'b' === x
if ('Moraug, Fury of Akoum' === x || 'Etali, Primal Conqueror' === x) { // salut }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
['a', 'b'].includes(x)
'a' === x || 'b' === x
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?