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
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 ...
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_reverse.asp
JavaScript Array reverse() Method
The reverse() method reverses the order of the elements in an array.
๐ŸŒ
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 ...
๐ŸŒ
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 ...
๐ŸŒ
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
Find elsewhere
๐ŸŒ
Quora
quora.com โ€บ What-is-the-most-efficient-way-to-reverse-a-Javascript-array
What is the most efficient way to reverse a Javascript array? - Quora
Answer (1 of 15): 1. Defining the need to reverse will produce much better answers and solutions. 2. Efficient to whom or what and does it matter to whom or what and why? 3. Avoid sorting large arrays in Javascript running in a web browser. 4. Reverse sorting choices: A dozen ways and counting...
๐ŸŒ
CoreUI
coreui.io โ€บ answers โ€บ how-to-reverse-an-array-in-javascript
How to reverse an array in JavaScript ยท CoreUI
May 14, 2026 - Use the reverse() method to flip the order of elements in a JavaScript array from last to first position.
๐ŸŒ
Reddit
reddit.com โ€บ r/learnjavascript โ€บ how do i reverse an array?
How do I reverse an array? : r/learnjavascript
February 10, 2022 - Try putting quotes around each item. "Item1", "Item2", "Item3" and then using the array.reverse() method.
๐ŸŒ
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.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ javascript-array-reverse-tutorial-with-example-js-code
JavaScript Reverse Array โ€“ Tutorial With Example JS Code
August 15, 2024 - 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:
๐ŸŒ
David Walsh
davidwalsh.name โ€บ javascript-reverse-array
JavaScript: Reverse Arrays
June 25, 2023 - To avoid this mutation, we'd copy the array and then reverse it: ... const arr = ['hi', 'low', 'ahhh']; const reversed = arr.toReversed(); // (3) ['ahhh', 'low', 'hi']; arr; // ['hi', 'low', 'ahhh'] Avoiding mutation of data objects is incredibly important in a programming language like JavaScript where object references are meaningful.
๐ŸŒ
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.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ TypedArray โ€บ reverse
TypedArray.prototype.reverse() - JavaScript | MDN
July 10, 2025 - The reverse() method of TypedArray instances reverses a typed array in place and returns the reference to the same typed array, the first typed array element now becoming the last, and the last typed array element becoming the first. In other words, elements order in the typed array will be ...
๐ŸŒ
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.
๐ŸŒ
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โ€ฆ
๐ŸŒ
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.
๐ŸŒ
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.
๐ŸŒ
Programiz
programiz.com โ€บ javascript โ€บ library โ€บ array โ€บ reverse
JavaScript Array reverse() (With Examples)
Note: The reverse() method reverses the order of elements in place, it means the method changes the original array. let languages = ["JavaScript", "Python", "C++", "Java", "Lua"];