JS: Array.prototype.shift
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]");
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]");