forEach vs loop (v69)

Revision 69 of this benchmark created on


Preparation HTML

<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>

Setup

var arr = [];
    for(var i = 0; i < 100000; i++) arr[i]=i;

Test runner

Ready to run.

Testing in
TestOps/sec
forEach
arr.forEach(function(v){v;});
ready
loop
for(var i = 0, l = arr.length; i < l; i++){arr[i];}
ready
lodash forEach
_.forEach(arr, function(v){v;})
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.