Run details:
Mozilla/5.0 (Linux; Android 9; Mi MIX 2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36
Chrome Mobile 81
Android
Mobile
4 years ago
Test name Executions per second
slice 27.4 Ops/sec
splice 167.6 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);