JS: Array.prototype.shift
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]");
arrayX.shift()
// example of shift const xx = [3, 4, 5]; const xy = xx.shift(); console.log(xy === 3); console.log(JSON.stringify(xx) === "[4,5]");