To remove first element from array and return the array minus the first element with JavaScript, we call the shift
method.
For instance, we write
const myArray = ["item 1", "item 2", "item 3", "item 4"];
myArray.shift();
console.log(myArray);
to call myArray.shift
to remove the first item of myArray
in place.