HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js'></script>
Script Preparation code:
 
var arr = {aa: 12, bb: 33, cc:44, dd: 4444};
Tests:
  • jQuery.each

     
    var temp;
    $.each(arr, function(key, val) {
      temp = val;
    });
  • Array.prototype.forEach

     
    var temp;
    Object.keys(arr).forEach(function(key) {
      temp = this;
    });
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    jQuery.each
    Array.prototype.forEach

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36
Chrome 84 on Windows
View result in a separate tab
Test name Executions per second
jQuery.each 1796474.8 Ops/sec
Array.prototype.forEach 1720761.0 Ops/sec