Shift

shift deletes the first index of that array and moves all indexes to the left. It changes the original array.

let array = [1, 2, 3]; 
array.shift(); 

// Result: array = [2,3]

Last updated

Was this helpful?