Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.142 Safari/537.36
Chrome 81
Linux
Desktop
4 years ago
Test name Executions per second
slice 18.5 Ops/sec
splice 94.6 Ops/sec
filter 10.8 Ops/sec
Script Preparation code:
AخA
 
var list = [];
for (var i = 0; i < 1000 * 1000; i++) {
  list.push(i);
}
Tests:
  • slice

     
    list = [
      ...list.slice(0, 50000),
      ...list.slice(50000 + 1)
    ];
  • splice

    x
     
    newList = [...list];
    newList.splice(50000, 1);
  • filter

     
    newList = list.filter(i => i !== 50000);