javascript remove n first element code example
Example 1: js remove first item
let myArray = [1, 2, 3, 4, 5];
let removedElement = myArray.shift();
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