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
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().
🌐
W3Schools
w3schools.com › jsref › jsref_reverse.asp
JavaScript Array reverse() Method
The reverse() method reverses the order of the elements in an array.
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
Reversing a JavaScript array without .reverse() / code explanation - JavaScript - SitePoint Forums | Web Development & Design Community
I was working on a problem on Codewars.com and I stumbled upon an interesting solution on StackOverflow. Someone was asking how to reverse an array WITHOUT using .reverse(). Here is one solution someone wrote: let reve… More on sitepoint.com
🌐 sitepoint.com
0
December 28, 2017
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
🌐
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.
🌐
Flexiple
flexiple.com › javascript › how-to-reverse-an-array
How to Reverse an Array In JavaScript – JS .reverse() Function - Flexiple
June 6, 2024 - Reversing an array in JavaScript is a straightforward task using the reverse() function. This function directly modifies the original array by inverting the order of its elements.
🌐
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…
Find elsewhere
🌐
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 ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › reverse-an-array-in-javascript
Reverse an Array in JavaScript - GeeksforGeeks
JavaScript provides a built-in array method called reverse() that reverses the elements of the array in place.
Published   July 23, 2025
🌐
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 - To reverse an array without modifying the original, we can clone the array with the slice() method and reverse the clone with the reverse() method.
🌐
SamanthaMing
samanthaming.com › tidbits › 74-how-to-reverse-an-array
How to reverse an array in JavaScript? | SamanthaMing.com
const benjamin = ['👶', '👦', '👨', '👴']; const benjaminButton = benjamin.reverse(); console.log(benjaminButton); // ['👴', '👨', '👦', '👶'] ... One thing to note is that it mutates the original array.
🌐
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.
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › program-to-reverse-an-array
Array Reverse - GeeksforGeeks
Auxiliary Space: O(1), no extra space is required, therefore we are reversing the array in-place. The idea is to use inbuilt reverse methods available across different languages.
Published   August 8, 2025
🌐
Vultr Docs
docs.vultr.com › javascript › standard-library › Array › reverse
JavaScript Array reverse() - Reverse Array Order | Vultr Docs
September 27, 2024 - The reverse() method in JavaScript is a straightforward and powerful function used to reverse the order of elements within an array.
🌐
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.
🌐
Educative
educative.io › answers › how-to-reverse-an-array-in-javascript
How to reverse an array in JavaScript
In JavaScript, reversing an array can be done using a built-in array method known as reverse().
🌐
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 ...
🌐
SitePoint
sitepoint.com › javascript
Reversing a JavaScript array without .reverse() / code explanation - JavaScript - SitePoint Forums | Web Development & Design Community
December 28, 2017 - I was working on a problem on Codewars.com and I stumbled upon an interesting solution on StackOverflow. Someone was asking how to reverse an array WITHOUT using .reverse(). Here is one solution someone wrote: let reverse=a=>[...a].map(a.pop,a) It helps me to look at it like this: (but I still don’t completely understand it) let reverse = (a) => { return [...a].map(a.pop, a); }; Original thread on StackOverflow I have used the spread operator, but not in this situation.
🌐
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]);
    }

🌐
Medium
medium.com › dailyjs › code-recipe-how-to-reverse-an-array-in-javascript-4a0306001d28
Code Recipe: How to Reverse an Array in JavaScript | by Samantha Ming | DailyJS | Medium
August 20, 2019 - Here are some recipes that won’t mutate the original array. Let’s take a look 👀 · const originalArray = ['a', 'b', 'c']; const newArray = originalArray.slice().reverse();console.log(originalA… ... JavaScript news and opinion.