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
July 20, 2025 - 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...
🌐
YouTube
youtube.com › florin pop
reverse Array Method | JavaScript Tutorial - YouTube
👉 Daily Coding Challenges: https://iCodeThis.com/?ref=ytb-js-reverseIn this tutorial we're going to learn about the #reverse #JavaScript #Array Method and h...
Published   April 3, 2020
Views   26K
🌐
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.
🌐
<div>ersions
madelinecaples.hashnode.dev › reverse-an-array-in-place-with-me
Reverse an array in place with me
April 8, 2024 - when counter equals the length of the array minus one we'll be done and break out of the while loop - that means the array is fully reversed
🌐
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 - The reverse() method reverses an array in place, so we call the slice() method on the array with no arguments, to return a copy of it.
🌐
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:
🌐
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.