Test name | Executions per second |
---|---|
Array.prototype.concat | 576.4 Ops/sec |
spread operator | 565.4 Ops/sec |
var list1 = [];
var list2 = [];
for(var i = 0; i<10000; i++) {list1.push(Math.random());list2.push(Math.random());}
var result = list1.concat(list2);
var list1 = [];
var list2 = [];
for(var i = 0; i<10000; i++) {list1.push(Math.random());list2.push(Math.random());}
var other = [ list1, list2 ]