shift()method removes the first element from an array and returns that element.
Returns the removed single value of the array.
var arr = [10, 1, 2, 3].shift(); console.log("Shifted value is : " + arr );
Its output is as follows −
Shifted value is : 10