Home >Web Front-end >JS Tutorial >Detailed explanation of the usage of reverse function in js_javascript skills

Detailed explanation of the usage of reverse function in js_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:06:592059browse

The reverse() method is used to reverse the order of elements in the array

Note: This method will change the original array but not create a new array.

Example:
var str = ['1','2','3'];

document.write(a);

Output: 3,2,1

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn