Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
every vs for x2
(version: 0)
Comparing performance of:
every vs for
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
window.a = Array(1_000_000).fill(2);
Tests:
every
function isTwoEvery() { return a.every(x => x === 2); } isTwoEvery()
for
function isTwoFor() { for (let i = 0, n = a.length; i < n; i++) { if (x !== 2) { return false; } } return true } isTwoFor()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
every
for
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?