Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Or vs includes
(version: 0)
Comparing performance of:
OR Invalid vs Or Valid vs Includes Invalid vs Includes valid
Created:
5 years ago
by:
Registered User
Jump to the latest result
Script Preparation code:
let a = [1,2] function returnOrInvalid() { return a[0] || a[1] == 3 } function returnOrValid() { return a[0] || a[1] == 2 } function returnIncludesInvalid() { return a.includes(3) } function returnIncludesValid() { return a.includes(2) }
Tests:
OR Invalid
returnOrInvalid()
Or Valid
returnOrValid()
Includes Invalid
returnIncludesInvalid()
Includes valid
returnIncludesValid()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
OR Invalid
Or Valid
Includes Invalid
Includes valid
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!
Related benchmarks:
typeof repetition vs array grouping
Return true vs return;
typeof Undefined vs ===
?. operator vs. getProperty
Nullish coalescing, logical OR
Comments
Confirm delete:
Do you really want to delete benchmark?