remove first string from array javascript code example
Example 1: remove first element from array javascript
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.shift();
Example 2: js remove first item
let myArray = [1, 2, 3, 4, 5];
let removedElement = myArray.shift();
Example 3: javascript remove first item from array
var colors = ["red", "green", "blue"];
var red=colors.shift();
//colors is now ["green","blue"];