how to remove the first element of an array code example
Example 1: remove first element from array javascript
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.shift();
Example 2: removing first item array js
var list = ["bar", "baz", "foo", "qux"];
list.shift()//["baz", "foo", "qux"]
Example 3: javascript how to remove first element of array
var colors = ["red", "blue", "green"]
var firstColor = colors.shift()
console.log(firstColor) // red
console.log(colors) // blue green