A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/Array/unshift below:

unshift · WebPlatform Docs

unshift Summary

Inserts new elements at the start of an array.

Syntax
unshift([ item1 [, item2 [, . . . [, itemN]]]])
item1, item2,. . ., itemN
Optional. Elements to insert at the start of the Array.
Examples

The following example illustrates the use of the unshift method.

var ar = new Array();
 ar.unshift(10, 11);
 ar.unshift(12, 13, 14);
 document.write(ar.toString());

 
Remarks

The unshift method inserts elements into the start of an array, so they appear in the same order in which they appear in the argument list.

See also Specification

[15.4.4.13 Array.prototype.unshift ( [ item1 [ , item2 , … ] ] )] ECMAScript® Language Specification Standard ECMA-262 5.1 Edition / June 2011

Attributions

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