Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
Chrome 89
Windows
Desktop
3 years ago
Test name Executions per second
native slice 373862.4 Ops/sec
lodash slice 71213.1 Ops/sec
HTML Preparation code:
AخA
 
1
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
 
var test = Array.from({
    length: 100000
}, () => Math.random())
Tests:
  • native slice

     
    test.slice(0,5000)
  • lodash slice

     
    _.slice(test, 0, 5000)