Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.36
Chrome Mobile 122
Android
Mobile
one year ago
Test name Executions per second
Push 682.9 Ops/sec
Join 8445.2 Ops/sec
Script Preparation code:
AخA
 
var strs = Array.from(new Array(10000)).map(() => 'String concat. ')
var result = []
Tests:
  • Push

     
    for (const str of strs) {
      result.push(str)
    }
  • Join

     
    result = strs.map((a) => a)