-The shift() method is similar as the pop() method but the difference is that Shift method works at the beginning of the array.
-The shift() method take the first element off of the given array and returns it. The array on which is called is then altered.
var myarray = ["apple ", "banana ", "mango "];
we get the following console output:
["banana ", "mango "];
When we call shift() on an empty array, it will return an undefined value.