Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
Firefox 125
Windows
Desktop
one year ago
Test name Executions per second
+= 33424.0 Ops/sec
push 37708.1 Ops/sec
Script Preparation code:
x
 
let a = ""
Tests:
  • +=

     
    let a = ""
    for (i = 0; i < 1000; i++) {
        a += i
    }
  • push

     
    let a = ""
    for (i = 0; i < 1000; i++) {
        a.concat(i)
    }