Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Firefox 132
Linux
Desktop
5 months ago
Test name Executions per second
slice 1421008.6 Ops/sec
filter 21000.8 Ops/sec
Script Preparation code:
AخA
 
var test=Array.from({length: 6000},()=>Math.random())
Tests:
  • slice

     
    [...test.slice(100,200)]
  • filter

     
    test.filter((e,i)=> i>=100 && i<=200)