Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Windows
Desktop
one year ago
Test name Executions per second
+= 162016.5 Ops/sec
push 162423.4 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)
    }