JavaScript Code

How to reverse an array of strings in JavaScript?

Reverse an array of strings in JavaScript

In this tutorial, you are given an array of strings. You should write a JavaScript program to reverse the order of elements in the array, or just reverse the array.


To reverse an array, use array method reverse(). reverse() method reverses the calling array in-place.


names is the given array of strings. We use reverse() method to reverse names array.

let names = ['Anita', 'Amy', 'America', 'Alba'];

copyright @2022