Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
Chrome 115
Linux
Desktop
one year ago
Test name Executions per second
Splice 24751628.0 Ops/sec
shift 34267160.0 Ops/sec
Script Preparation code:
AخA
 
var array = Array.from({ length: 100 }).map((val, i) => i);
Tests:
  • Splice

     
    var newArray = array.splice(0, 0);
  • shift

     
    var newArray = array.shift();