Reverses the elements in an Array.
Syntaxreverse()
Return Value
The reversed array.
ExamplesThe 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 Specification15.4.4.8 Array.prototype.reverse ( ) 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