Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.some vs for loop
Compare loop performance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:141.0) Gecko/20100101 Firefox/141.0
Browser:
Firefox 141
Operating system:
Linux
Device Platform:
Desktop
Date tested:
9 months ago
Test name
Executions per second
for
1717974.0 Ops/sec
some
141754.1 Ops/sec
Script Preparation code:
var array = new Array(1000).fill(''); array = array.map((tem, idx) => idx) var result = false;
Tests:
for
for (var i = 0; i < array.length; i++) { if (array[i] === 888) { result = true; break; } }
some
result = array.some(function(i) { return array[i] === 888; });