Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
is find faster than forEach? fork
(version: 0)
Comparing performance of:
forEach vs find vs for
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = Array(10000).map((_, i)=>i);
Tests:
forEach
arr.forEach(() => item === 100)
find
arr.find((item) => item === 100)
for
for (let i = 0; i < arr.length; i++) { if (arr[i] === 100) { break; } }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
forEach
find
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!
Related benchmarks:
is find faster than forEach?
Array.forEach vs Object.keys().forEach
Array loop vs foreach vs map fixed by bomi
Array fill map, vs for i loop
Comments
Confirm delete:
Do you really want to delete benchmark?