Array methods
Array.prototype.shift()
Removes the first position, moves following indexed positions down, and reduces length. Empty arrays return undefined.
Formal Syntax & Structure
javascript syntaxjavascript
array.shift()Return Value
any
Removed first value or undefined.
Working Example
Example Snippetjavascript
const a=[2,4];console.log(a.shift(),a[0]);