Tests:
  • each

    AخA
     
    var array = [0,1,2,3,4];
    array.forEach((num) => {
      console.log(num);
    });
  • for

     
    var array = [0,1,2,3,4];
    for (var i = 0; i < array.length; i++) {
      console.log(array[i]);
    };
  • while

     
    var array = [0,1,2,3,4];
    var i = 0;
    while (i < array.length) {
     console.log(array[i]);
      i++;
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    each
    for
    while

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 years ago)
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36
Chrome 54 on Windows
View result in a separate tab
Test name Executions per second
each 4101.8 Ops/sec
for 4196.0 Ops/sec
while 2933.2 Ops/sec