Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
shift()
The removed element.
var drinks = ["coffee", "tea", "water"]
print("Removed element:", drinks.shift())
print("Array now contains:", drinks)
Removed element: coffee
Array now contains: tea,water