array pop first eelemt n code example
Example 1: javascript array delete first element
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.shift();
// var fruits = ["Orange", "Apple", "Mango"];
Example 2: 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