Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15
Safari 14
Mac OS X 10.15.6
Desktop
3 years ago
Test name Executions per second
slice 114.9 Ops/sec
splice 192.2 Ops/sec
filter 183.4 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);