Test name | Executions per second |
---|---|
Spread | 3147.2 Ops/sec |
Slice | 2966.1 Ops/sec |
Array.from | 3048.6 Ops/sec |
<!--your preparation HTML code goes here-->
const array = Array.from({ length: 128000 }, (_, i) => { return { i } })
const copy = [array];
const copy = array.slice();
const copy = Array.from(array);