remove the first element of array javascript 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();
Example 3: javascript array remove first
let yourArray = ["aaa", "bbb", "ccc", "ddd"];
yourArray.shift();
Example 4: how to remove first element of array in javascript
let numbers = ["I'm Not A Number!", 1, 2, 3];
numbers.shift();