Removes the first element from an array and returns it.
Syntaxshift( )
Return Value
Returns the element removed from the array.
ExamplesThe following example illustrates the use of the shift method.
var arr = new Array(10, 11, 12);
while (arr.length > 0)
{
var i = arr.shift();
document.write (i.toString() + " ");
}
See also Specification
15.4.4.9 Array.prototype.shift ( ) ECMAScript® Language Specification Standard ECMA-262 5.1 Edition / June 2011
AttributionsMicrosoft Developer Network: Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4