Array.shift

Array.shift

Array.shift

Function

Delete and return the first element of the array.

Syntax

Parameters

No parameters.

Return value

TypeDescription
Any/EmptyReturns the deleted element if the array is not empty; returns Empty for an empty array.

Example

Notes

  • This method will modify the original array.