Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
every vs for loop
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0
Browser:
Firefox 135
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
every
12.5M/s
for loop
6.7M/s
View exact numbers
Test name
Executions per second
✓
every
12,468,619 Ops/sec
for loop
6,675,394 Ops/sec
Tests:
every
const a = [1, 2, 3, 4, 5]; const b = [1, 2, 4, 5, 3, 5]; a.every(x => b.some(y => x === y));
for loop
const a = [1, 2, 3, 4, 5]; const b = [1, 2, 4, 5, 3, 5]; for (let i = 0, l = a.length; i < l; i++) { if (!b.some(y => a[i] === y)) { break; } }