This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.

Smartphone icons created by Freepik - Flaticon

JavaScript Arrays

The shift() Method

The shift() method removes the first element of an array (and "shifts" the other elements to the left):

const fruits = ["Banana", " Orange", " Apple", " Mango"];
document.getElementById("demo1").innerHTML = fruits;
fruits.shift();
document.getElementById("demo2").innerHTML = fruits;