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
🌐
Medium
medium.com › @jsutcliffe1991 › javascript-array-method-simply-reverse-a-string-reverse-vs-toreversed-join-649e7a4f5e97
Javascript Array Method: Simply Reverse a String / .reverse() vs .toReversed() / .join() | by James Robert Sutcliffe | Medium
July 6, 2023 - The aformentioned array method is the simple but effective .reverse(), as we can see we now have a reversed array stored in the reverse variable. Below this we can see that when logging our split variable it now also returns as reversed.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › reverse
Array.prototype.reverse() - JavaScript | MDN
The reverse() method of Array instances reverses an array in place and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite ...
Discussions

How can I reverse an array in JavaScript without using libraries? - Stack Overflow
I am saving some data in order using arrays, and I want to add a function that the user can reverse the list. I can't think of any possible method, so if anybody knows how, please help. More on stackoverflow.com
🌐 stackoverflow.com
How can I reverse an array in JavaScript without modifying the original array?
The method Array.prototype.reverse changes the original array by reversing its elements. I’m looking for an easy way to reverse an array while ensuring that the original array remains unchanged. Is there a straightforward approach to achieve this? More on community.latenode.com
🌐 community.latenode.com
0
0
November 6, 2024
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
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 23, 2024
🌐
BigBinary Academy
courses.bigbinaryacademy.com › learn-javascript › array-methods-3 › reverse-elements-in-array
Reverse elements in array - JavaScript | BigBinary Academy
The `reverse()` method modifies the original array and returns the array with the elements in reverse order. Syntax:
🌐
W3Schools
w3schools.com › jsref › jsref_reverse.asp
W3Schools.com
JS Arrays · Array[ ] Array( ) at() concat() constructor copyWithin() entries() every() fill() filter() find() findIndex() findLast() findLastIndex() flat() flatMap() forEach() from() includes() indexOf() isArray() join() keys() lastIndexOf() length map() of() pop() prototype push() reduce() reduceRight() rest (...) reverse() shift() slice() some() sort() splice() spread (...) toReversed() toSorted() toSpliced() toString() unshift() values() valueOf() with() JS Boolean ·
🌐
Altcademy
altcademy.com › blog › how-to-reverse-an-array-in-javascript
How to reverse an array in JavaScript
June 9, 2023 - It's important to note that the reverse() method modifies the original array. If you want to reverse the array without changing the original array, you can create a copy of the array first, and then reverse it.
Find elsewhere
🌐
Sabe
sabe.io › blog › javascript-reverse-array
How to Reverse an Array in JavaScript | Sabe
September 26, 2022 - The easiest way to reverse an array is to use the built-in reverse method.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › toReversed
Array.prototype.toReversed() - JavaScript | MDN
July 10, 2025 - The toReversed() method transposes the elements of the calling array object in reverse order and returns a new array.
🌐
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 - 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 ...
🌐
Accreditly
accreditly.io › articles › how-to-reverse-an-array-in-javascript
How to reverse an array in JavaScript - Accreditly
August 2, 2023 - The Array.reverse() method is the most straightforward way to reverse an array in JavaScript.
🌐
CoreUI
coreui.io › answers › how-to-reverse-an-array-in-javascript
How to reverse an array in JavaScript · CoreUI
September 20, 2025 - Use the reverse() method to flip the order of elements in a JavaScript array from last to first position.
🌐
WsCube Tech
wscubetech.com › resources › javascript › programs › reverse-array
JavaScript Program to Reverse an Array (8 Ways)
January 20, 2026 - Learn JS program to reverse an array using 8 different methods with examples and outputs. A complete guide for beginners to master array manipulation.
🌐
Latenode
community.latenode.com › other questions › javascript
How can I reverse an array in JavaScript without modifying the original array? - JavaScript - Latenode Official Community
November 6, 2024 - The method Array.prototype.reverse changes the original array by reversing its elements. I’m looking for an easy way to reverse an array while ensuring that the original array remains unchanged. Is there a straightforwar…
🌐
Favtutor
favtutor.com › articles › reverse-array-javascript
Reverse an Array in JavaScript | reverse() method
December 4, 2023 - Inside the function, we use the unshift() method to add the currentValue to the beginning of the accumulator array, effectively reversing the order of the elements. Finally, we return the accumulator array as the result of the reduce() method.
🌐
Codecademy
codecademy.com › docs › javascript › arrays › .reverse()
JavaScript | Arrays | .reverse() | Codecademy
June 1, 2023 - Reverses the order of the elements of an array in place and returns the reversed array.
🌐
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]);
    }

🌐
Alexanderkaran
blog.alexanderkaran.com › reversing-arrays-in-javascript
Reversing Arrays in JavaScript
August 20, 2023 - The first method is Array.prototype.reverse() which reverses the array in place, meaning we change the original array.
🌐
Reddit
reddit.com › r/learnjavascript › reversing an array
r/learnjavascript on Reddit: Reversing an array
September 23, 2024 -

So I'm reading Eloquent Javascript third edition, and one of the end of chapter exercises state this:

"Arrays have a reverse method that changes the array by inverting the order in which its elements appear. For this exercise, write two functions, reverseArray and reverseArrayInPlace. The first, reverseArray, takes an array as 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 by reversing its elements. Neither may use the standard reverse method."

I'm having a hard time understanding what it's asking me to do and what I need to write in order to pass this.