shifting array code example
Example 1: js remove first item
let myArray = [1, 2, 3, 4, 5];
let removedElement = myArray.shift();
Example 2: javascript remove first item from array
var colors = ["red", "green", "blue"];
var red=colors.shift();
//colors is now ["green","blue"];