Prev Demo
Reverse The Order Of Numbers In An Array
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to reverse the order of numbers.</p> <input type="button" onclick="myValue()" value="Reverse"/> <p id="myId"></p> <script> function myValue() { var a = [1, 2, 3, 4, 5, 6, 7, 8, 9]; var b = a.reverse(); document.getElementById("myId").innerHTML = b; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output