delete first index of array 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: remove first element of array javascript
const arr = ['foo', 'bar', 'qux', 'buz'];
arr.shift(); // 'foo'
arr; // ['bar', 'qux', 'buz']
Example 3: javascript array delete first element
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.shift();
// var fruits = ["Orange", "Apple", "Mango"];