Reverse-1

 

JavaScript reverse function is used to reverse the array. arr.reverse() will reverse the array values. See the code snippet:

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <script> var arr= ['abc', 'xyz', 'def']; arr.reverse(); document.write(arr); </script> </body> </html>
Output