Test name | Executions per second |
---|---|
Array.slice() | 69146.9 Ops/sec |
Spread operator | 10869.4 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.20/lodash.min.js'></script>
var arr = new Array(10000).fill(0);
var myCopy = arr.slice()
var myCopy = [arr]