javascript reverse() method
Translation results:
UK[rɪˈvɜ:s] US[rɪˈvɜ:rs]
vt.& vi. (to make) reverse; (to make) reverse; swap, exchange; [French] cancel, overturn
vi.Backward;[Bridge]Reverse
adj.Reverse; reversed; reversed; [raw] reversed
n.Inverted, reverse;[ machine] to reverse; to reverse; to fail
Third person singular: reverses Plural: reverses Present participle: reversing Past tense: reversed Past participle: reversed
javascript reverse() methodsyntax
How to use the reverse() method?
The reverse() method can be used to reverse the order of elements in the array. The front element will become the last element.
#Function: Used to reverse the order of elements in the array.
Syntax: arrayObject.reverse()
Comments: This method will change the original array without creating a new array.
javascript reverse() methodexample
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <script type="text/javascript"> var arr = new Array(3) arr[0] = "George" arr[1] = "John" arr[2] = "Thomas" document.write(arr + "<br />") document.write(arr.reverse()) </script> </body> </html>
Run instance »
Click the "Run instance" button to view the online instance
Popular Recommendations
- Reverse 1999 codes for September 2024
- Bitcoin Must Overcome The 200-Day SMA To Reverse Trend
- How to Reverse a String in JavaScript Using a For Loop
- Dogecoin (DOGE) Price Analysis: Stasis Broken, But Can the Meme Coin Reverse the Trend?
- Modder converts 1986 Apple IIGS keyboard to wireless with impeccable reverse engineering and modern features
- DOGE Price Drops 16% in a Week, Can Memebet Casino (MEMEBET) Token Reverse the Trend?