Script Preparation code:
AخA
 
arr1 = [[1,2,3],[1,2,3],[1,2,3]]
Tests:
  • for..of

    x
     
    result = []
    for(const arr of arr1) {
     for (const num of arr) {
        if (num === 2) {
         result.push(num) 
         continue
        }
     }
    }
  • for each

     
    result = []
    arr1.forEach((arr) => {
     arr.forEach((num) => {
      if(num === 2) {
        result.push(num)
      }
     }) 
    })
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    for..of
    for each

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0
Firefox 81 on Windows
View result in a separate tab
Test name Executions per second
for..of 6256677.5 Ops/sec
for each 4642170.5 Ops/sec