remove first n item from array code example
Example 1: how to delete an element from an array
var array = [123, "yee", true];
array.pop(index);
Example 2: remove elemtns from an array with splice
var fruits = ["Banana", "Orange", "Apple", "Mango", "Kiwi"];
document.getElementById("demo").innerHTML = fruits;
function myFunction() {
fruits.splice(2, 2);
document.getElementById("demo").innerHTML = fruits;
}