1//The shift() method removes the first element from an array
2//and returns that removed element.
3//This method changes the length of the array.
4
5const array1 = [1, 2, 3];
6const firstElement = array1.shift();
7console.log(array1);
8// expected output: Array [2, 3]
9console.log(firstElement);
10// expected output: 1
11
1
2const fruits = ["Banana", "Orange", "Apple", "Mango"];
3
4fruits.shift(); // Removes "Banana" from fruits
5