Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
find vs for loop
Compare find vs for loop
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0
Browser:
Firefox 120
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Using for loop
145621088.0 Ops/sec
Using find
66239196.0 Ops/sec
Script Preparation code:
var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
Tests:
Using for loop
var found; for (var i = 0; i < array.length; i++) { if (i > 10) { found = i; break; } }
Using find
var found; array.find((i) => { if (i > 10) { found = i; return true; } });