Test name | Executions per second |
---|---|
Array.prototype.slice | 525207.2 Ops/sec |
spread operator | 577553.2 Ops/sec |
Push operation | 10684.3 Ops/sec |
var arr = Array.from({length: 10000}, () => Math.random())
var other = arr.slice();
var other = [ arr ]
var other = []
arr.forEach(el => other.push(el))