jQuery.each vs _.each vs for loop (v25)

Revision 25 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>

<script>
  var array = $('*').get();
</script>

Setup

var $ = window.$;
    var _ = window._;
    var lodash = window.lodash;
    
    var e;
    var array = window.array;

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery.each
$.each(array, function(index, element) { e = element; })
ready
_.each (underscore)
_.each(array, function(element, index) { e = element; });
ready

Revisions

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