underscore.each vs jquery.each (v5)

Revision 5 of this benchmark created on


Description

who is the best between _.each and $.each you can find another test on http://jsperf.com/jquery-each-vs-underscore-each

Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script>
  var a = ['a', 2,
  {
   c: true
  }]
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
underscore each
_.each(a, function(value, key) {
 '' + key;
});
ready
jquery each
jQuery.each(a, function(key, value) {
 '' + key;
});
ready

Revisions

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