shift javascript

JavaScript
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.shift();var list = ["bar", "baz", "foo", "qux"];
list.shift()//["baz", "foo", "qux"]var colors = ["red", "green", "blue"];
var red=colors.shift();
//colors is now ["green","blue"];let myArray = [1, 2, 3, 4, 5];

let removedElement = myArray.shift(); var arr = [1, 2, 3, 4]; 
var theRemovedElement = arr.shift(); // theRemovedElement == 1
console.log(arr); // [2, 3, 4]/*The shift() method removes an element from the beginning of an array, 
while pop() removes an element from the end.*/

let greetings = ['whats up?', 'hello', 'see ya!'];

greetings.shift();
// now equals ['hello']

greetings.pop();
// now equals ['whats up?', 'hello']
Source

Also in JavaScript: