JS: Array.prototype.shift

By Xah Lee. Date: . Last updated: .
xArray.shift()

Remove and return the first item.

// example of shift
const xx = [3, 4, 5];
const yy = xx.shift();
console.log(yy === 3);
console.log(JSON.stringify(xx) === "[4,5]");

JavaScript. Array Push Pop