Test name | Executions per second |
---|---|
slice | 96.0 Ops/sec |
splice | 580.2 Ops/sec |
filter | 59.9 Ops/sec |
var list = [];
for (var i = 0; i < 1000 * 1000; i++) {
list.push(i);
}
list = [
list.slice(0, 50000),
list.slice(50000 + 1)
];
newList = [list];
newList.splice(50000, 1);
newList = list.filter(i => i !== 50000);