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
Jump 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:
9 months 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
Test name
Executions per second
lodash
95891.1 Ops/sec
native
95496.3 Ops/sec
for of
93388.7 Ops/sec
Related benchmarks:
lodash .foreach vs native foreach
lodash .forEach vs JS forEach
lodash foreach vs native foreach (mmr)
lodash.each vs Object.forEach vs Native for
lodash vs native foreach
lodash .foreach vs JS native foreach
Lodash vs Native v3,0,0
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?