Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
Chrome 67
Windows
Desktop
6 years ago
Test name Executions per second
Slice & Splice 1162614.1 Ops/sec
ES6 Array Creation 731473.5 Ops/sec
Script Preparation code:
AخA
 
var array = Array.from({ length: 100 }).map((val, i) => i);
Tests:
  • Slice & Splice

     
    var messages = array.slice().splice(38, 1);
  • ES6 Array Creation

     
    var messages = [...array].splice(38, 1);