The shift() method of an array removes the first element of the array and returns it.
const numbers = [1, 2, 3, 4, 5];
const numbersShift = numbers.shift();
console.log(numbersShift);
// 1
The shift() method of an array removes the first element of the array and returns it.
const numbers = [1, 2, 3, 4, 5];
const numbersShift = numbers.shift();
console.log(numbersShift);
// 1