Javascript Shift() Function

The shift() function of array object removes the first element from an array and returns that element. Use it for example to remove first element of array.

Syntax

Javascript Shift Method Example

This will produce following result