JS: Array.prototype.shift

By Xah Lee. Date: . Last updated: .
arrayX.shift()
Remove and return the first item.
// example of shift

const xx = [3, 4, 5];

const xy = xx.shift();

console.log(xy === 3);
console.log(JSON.stringify(xx) === "[4,5]");

JavaScript, Array, add/remove items

BUY ΣJS JavaScript in Depth