Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
every vs for loop small arrays single setup
(version: 0)
Comparing performance of:
every vs for loop
Created:
2 years ago
by:
Registered User
Jump to the latest result
Script Preparation code:
window.a = [1, 2, 3, 4, 5]; window.b = [1, 2, 4, 5, 3, 5];
Tests:
every
a.every(x => b.some(y => x === y));
for loop
for (let i = 0, l = a.length; i < l; i++) { if (!b.some(y => a[i] === y)) { break; } }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
every
for loop
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?