Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lodash.foreach vs for-of vs array.forEach
(version: 1)
Comparing performance of:
lodash.foreach vs native for-of vs native for-of + entries vs native forEach
Created:
2 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js"></script>
Script Preparation code:
var arr = Array.from({ length: 10000 }).map((value, i) => i);
Tests:
lodash.foreach
_.forEach(arr, function(e, i) {})
native for-of
for (const e of arr) {}
native for-of + entries
for (const [i, e] of arr.entries()) {}
native forEach
arr.forEach(function(e, i) {})
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
lodash.foreach
native for-of
native for-of + entries
native forEach
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:
lodash vs for-of vs forEach
lodash vs for-of vs forEach es6
lodash foreach vs for-of vs forEach
lodash vs for-of vs forEach vs map v2
Comments
Confirm delete:
Do you really want to delete benchmark?