array pop from beginning code example
Example 1: remove first element from array javascript
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.shift();
Example 2: javascript remove first item from array
var colors = ["red", "green", "blue"];
var red=colors.shift();
//colors is now ["green","blue"];
Example 3: removing first item array js
var list = ["bar", "baz", "foo", "qux"];
list.shift()//["baz", "foo", "qux"]