Tests:
  • forEach

    AخA
     
    const a = [1,2,3,4,5,6,7,8,9,10]
    const b = []
    a.forEach(item => {
      b.push(item)
    })
  • for loop

     
    const a = [1,2,3,4,5,6,7,8,9,10]
    const b = []
    for (let i=0;i<a.length;i++) {
      b.push(a[i])
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    forEach
    for loop

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0
Firefox 120 on Windows
View result in a separate tab
Test name Executions per second
forEach 9856052.0 Ops/sec
for loop 9241291.0 Ops/sec