Home >Web Front-end >JS Tutorial >Detailed explanation of the usage of reverse function in js_javascript skills
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