Javascript has a reverse() method that you can call in an array

var a = [3,5,7,8];
a.reverse(); // 8 7 5 3

Not sure if that's what you mean by 'libraries you can't use', I'm guessing something to do with practice. If that's the case, you can implement your own version of .reverse()

function reverseArr(input) {
    var ret = new Array;
    for(var i = input.length-1; i >= 0; i--) {
        ret.push(input[i]);
    }
    return ret;
}

var a = [3,5,7,8]
var b = reverseArr(a);

Do note that the built-in .reverse() method operates on the original array, thus you don't need to reassign a.

Answer from Andreas Wong on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › reverse
Array.prototype.reverse() - JavaScript - MDN Web Docs
In other words, elements order in the array will be turned towards the direction opposite to that previously stated. To reverse the elements in an array without mutating the original array, use toReversed().
Discussions

How do I reverse an array?
There’s a reverse method on arrays. All you would need here is array.reverse() But you’re missing the closing quotes. Right now it’s an array of one string. More on reddit.com
🌐 r/learnjavascript
17
5
February 10, 2022
Reversing an Array in JavaScript.
Tony Nguyen is having issues with: Hello Fellow Students! I am trying to figure out an algorithm problem to where I would have to reverse the order of an Array. Fo... More on teamtreehouse.com
🌐 teamtreehouse.com
2
May 15, 2015
Reversing an array
After you’ve written it, the two functions will behave like this: let original = [1, 2, 3]; const reversed = reverseArray(original); console.log(original); // [1, 2, 3] console.log(reversed); // [3, 2, 1] reverseArrayInPlace(original); console.log(original); // [3, 2, 1] Note that we don’t create a new variable for the return value of reverseArrayInPlace, it changes (“mutates”) the array that was passed into it. More on reddit.com
🌐 r/learnjavascript
20
6
September 24, 2024
Lazy Reverse Method in O(1) Time
There is reversed(list_object). More on reddit.com
🌐 r/Python
45
27
July 7, 2024
🌐
W3Schools
w3schools.com › jsref › jsref_reverse.asp
JavaScript Array reverse() Method
The reverse() method overwrites the original array. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript ...
🌐
ReqBin
reqbin.com › code › javascript › rgwrzonz › javascript-reverse-array-example
How do I reverse an array in JavaScript?
The array.reverse() method in JavaScript is used to reverse an array in place. The reverse() method reverses the array immediately; this means that the original elements of the array are swapped, and the original sequence is lost.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › reverse-an-array-in-javascript
Reverse an Array in JavaScript - GeeksforGeeks
You can use recursion by removing the first element of the array, reversing the rest of the array, and then pushing the removed element to the end of the reversed array.
Published   July 23, 2025
🌐
TutorialsPoint
tutorialspoint.com › javascript › array_reverse.htm
JavaScript - Array reverse() Method
If the array is empty and we try ... nothing as output. <html> <body> <p id="demo"></p> <script> const animals = []; document.getElementById("demo").innerHTML = animals.reverse(); </script> </body> </html>...
🌐
Medium
josephcardillo.medium.com › how-to-reverse-arrays-in-javascript-without-using-reverse-ae995904efbe
How to Reverse Arrays in JavaScript Without Using .reverse() | by Joe Cardillo | Medium
January 31, 2022 - Specifically, take this problem from Eloquent JavaScript, 2nd Edition: Write two functions reverseArray and reverseArrayInPlace. The first, reverseArray, takes an array as an argument and produces a new array that has the same elements in the inverse order. The second, reverseArrayInPlace, does what the reverse method does: it modifies the array given as argument in order to reverse its elements.
Find elsewhere
🌐
Programiz
programiz.com › javascript › library › array › reverse
JavaScript Array reverse() (With Examples)
Reversed Array: [ 'Lua', 'Java', 'C++', 'Python', 'JavaScript' ] Original Array: [ 'Lua', 'Java', 'C++', 'Python', 'JavaScript' ] In the above example, we have used the reverse() method to reverse the languages array.
🌐
Flexiple
flexiple.com › javascript › reverse-javascript-array
JavaScript: Reverse an array using different methods - Flexiple
... arr = [1, 2, 3, 4]; arr1 = []; for (let i = arr.length - 1; i >= 0; i--) { arr1.push(arr[i]); } console.log(arr1); //Output: [4, 3, 2, 1] In the above example, we use a decrementing loop to traverse the array arr from backward and store ...
🌐
freeCodeCamp
freecodecamp.org › news › how-to-reverse-an-array-in-javascript-js-reverse-function
How to Reverse an Array in JavaScript – JS .reverse() Function
November 29, 2022 - By Dillion Megida In this article, I'll show you two ways to reverse arrays in JavaScript. The reverse method of arrays reverses an array by making the last item the first, and making the first item the last. The other items in between also get rever...
🌐
freeCodeCamp
freecodecamp.org › news › javascript-array-reverse-tutorial-with-example-js-code
JavaScript Reverse Array – Tutorial With Example JS Code
January 18, 2021 - When you need to reverse an array in JavaScript, you can use the reverse method, which will put the last element first and the first element last:
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › toReversed
Array.prototype.toReversed() - JavaScript - MDN Web Docs
July 10, 2025 - The toReversed() method transposes the elements of the calling array object in reverse order and returns a new array. When used on sparse arrays, the toReversed() method iterates empty slots as if they have the value undefined. The toReversed() method is generic.
🌐
Flexiple
flexiple.com › javascript › how-to-reverse-an-array
How to Reverse an Array In JavaScript – JS .reverse() Function - Flexiple
June 6, 2024 - To reverse an array using a for loop in JavaScript. Begin by declaring an empty array that will hold the reversed elements. This new array is essential for storing elements in reverse order.
🌐
Reddit
reddit.com › r/learnjavascript › how do i reverse an array?
r/learnjavascript on Reddit: How do I reverse an array?
February 10, 2022 -

I'm trying to print this array in reverse order but I don't really know much about JavaScript and I thought I found a solution but it only works with numbers and I don't really know what to do. Any help I'm thankful for

Heres my code

var array = ["Item1, Item2, Item3"];

for(var a = array.length-1; a >= 0; a--) {
document.write(array[a]);
    }

🌐
CoreUI
coreui.io › answers › how-to-reverse-an-array-in-javascript
How to reverse an array in JavaScript · CoreUI
September 20, 2025 - The reverse() method reverses the ... array. In this example, numbers.reverse() changes the array from [1, 2, 3, 4, 5] to [5, 4, 3, 2, 1], with the last element becoming the first and vice versa....
🌐
SamanthaMing
samanthaming.com › tidbits › 74-how-to-reverse-an-array
How to reverse an array in JavaScript? | SamanthaMing.com
const originalArray = ['a', 'b', 'c']; const newArray = originalArray.reverse(); console.log(originalArray); // [ 'c', 'b', 'a' ] console.log(newArray); // [ 'c', 'b', 'a' ] Here are some recipes that won't mutate the original array.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-array-reverse-method
JavaScript Array reverse() Method - GeeksforGeeks
July 14, 2024 - The JavaScript Array reverse() method reverses the order of the elements in an array in place. The first array element becomes the last, and the last element becomes the first, and so on.
🌐
JavaScript in Plain English
javascript.plainenglish.io › javascript-reverse-array-without-modifying-dac063623490
How to Reverse an Array without Modifying in JavaScript | by Tari Ibaba | JavaScript in Plain English
August 21, 2024 - We can also reverse an array without modifying it by creating a reverse for loop, and in each iteration, adding the array element whose index is the current value of the loop counter to a new array.
🌐
Reality Ripple
udn.realityripple.com › docs › Web › JavaScript › Reference › Global_Objects › Array › reverse
Array.prototype.reverse() - JavaScript
The call to reverse() returns a reference to the reversed array a. const a = [1, 2, 3]; console.log(a); // [1, 2, 3] a.reverse(); console.log(a); // [3, 2, 1] The following example creates an array-like object a, containing three elements and a length property, then reverses the array-like object.