Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
if [].includes vs if 'a' === x || 'b' === x
(version: 0)
Comparing performance of:
if (['a', 'b'].includes(x)) vs if ('a' === x || 'b' === x)
Created:
2 years ago
by:
Guest
Jump to the latest result
Tests:
if (['a', 'b'].includes(x))
const x = 'Etali, Primal Storm'; if (['Moraug, Fury of Akoum', 'Etali, Primal Conqueror'].includes(x)) { return true; }
if ('a' === x || 'b' === x)
const x = 'Etali, Primal Storm'; if ('Moraug, Fury of Akoum' === x || 'Etali, Primal Conqueror' === x) { return true; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
if (['a', 'b'].includes(x))
if ('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?