Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lodash .foreach vs native foreach vs for..of..
(version: 1)
Comparing performance of:
lodash vs native vs for of
Created:
one year ago
by:
Guest
Go to the latest result
HTML Preparation code:
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js'></script>
Script Preparation code:
var value = [{a: 30310}, {b: 100303}, {c: 3040494}, {d: 6542321}, {e: 13123531}]
Tests:
lodash
_.each(value, function(v,i) {console.log(v)})
native
value.forEach(function(v,i) {console.log(v)})
for of
for (const v of value) { console.log(v) }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
lodash
native
for of
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:141.0) Gecko/20100101 Firefox/141.0
Browser/OS:
Firefox 141 on Mac OS X 10.15
View result in a separate tab
Embed
Embed Benchmark Result
lodash
96K/s
native
95K/s
for of
93K/s
View exact numbers
Test name
Executions per second
✓
lodash
95,891 Ops/sec
native
95,496 Ops/sec
for of
93,389 Ops/sec
Related benchmarks
lodash .foreach vs native foreach
lodash .forEach vs JS forEach
lodash .foreach vs native foreach vs native forof
lodash .foreach vs native foreach vs native for loop
Comments
Confirm delete:
Do you really want to delete benchmark?