1var arr = [1, 2, 3, 4];
2var theRemovedElement = arr.shift(); // theRemovedElement == 1
3console.log(arr); // [2, 3, 4]
1const array1 = [1, 2, 3];
2
3const firstElement = array1.shift();
4
5console.log(array1);
6// expected output: Array [2, 3]
7
8console.log(firstElement);
9// expected output: 1
1const arr = ['foo', 'bar', 'qux', 'buz'];
2
3arr.shift(); // 'foo'
4arr; // ['bar', 'qux', 'buz']
1var fruits = ["Banana", "Orange", "Apple", "Mango"];
2fruits.shift();
3// var fruits = ["Orange", "Apple", "Mango"];