js pop from beginning code example
Example 1: javascript remove first item from array
var colors = ["red", "green", "blue"];
var red=colors.shift();
//colors is now ["green","blue"];
Example 2: javascript shift
let array = ["A", "B", "C"];
//Removes the first element of the array
array.shift();
//===========================
console.log(array);
//output =>
//["B", "C"]