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/reverse below:

reverse · WebPlatform Docs

reverse Summary

Reverses the elements in an Array.

Syntax
reverse()
Return Value

The reversed array.

Examples

The following example illustrates the use of the reverse method.

var arr = new Array(0,1,2,3,4);
 var reverseArr = arr.reverse();
 document.write(reverseArr);

 
 
Remarks

The required arrayObj reference is an Array object.

The reverse method reverses the elements of an Array object in place. It does not create a new Array object during execution.

If the array is not contiguous, the reverse method creates elements in the array that fill the gaps in the array. Each of these created elements has the value undefined.

See also Specification

15.4.4.8 Array.prototype.reverse ( ) 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