js get and remove first element from array code example
Example 1: remove first element from array javascript
const array1 = [1, 2, 3];
const firstElement = array1.shift();
console.log(array1);
console.log(firstElement);
Example 2: es6 remove first element of array
var myarray = ["item 1", "item 2", "item 3", "item 4"];
alert(myarray.shift());
alert(myarray.pop());
Example 3: javascript array remove first
let yourArray = ["aaa", "bbb", "ccc", "ddd"];
yourArray.shift();
Example 4: javascript remove first item from array
type answer