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
🌐
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 ...
🌐
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().
🌐
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>...
🌐
ReqBin
reqbin.com › code › javascript › rgwrzonz › javascript-reverse-array-example
How do I reverse an array in JavaScript?
let array = ['JavaScript', 'Array', 'Reverse', 'Example']; let newArray = []; for(i = array.length-1; i >= 0; i--) { newArray.push(array[i]); } console.log(newArray); // output: ['Example', 'Reverse', 'Array', 'JavaScript']
🌐
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.
🌐
W3Schools
w3schools.com › jsref › jsref_array_toreversed.asp
JavaScript Array toReversed() Method
The toReversed() method does not overwrites the original array. The toReversed() method is the copying version of the reverse() method. ... 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 Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
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 get rever...
🌐
W3Schools
w3schools.com › Jsref › jsref_typed_reverse.asp
JavaScript Typed 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 ...
🌐
GeeksforGeeks
geeksforgeeks.org › reverse-an-array-in-javascript
Reverse an Array in JavaScript | GeeksforGeeks
January 20, 2025 - Given there are two sorted arrays, we need to merge them into a single sorted array in JavaScript. We will see the code for each approach along with the output. Below are the possible approaches t ... Inversion Count for an array indicates - how far (or close) the array is from being sorted. If the array is already sorted, then the inversion count is 0, but if the array is sorted in the reverse order, the inversion count is the maximum. Formally speaking, two elements a[i] and a[j] form an invers
🌐
W3Schools
devcom.w3schools.com › jsref › jsref_reverse.asp
JavaScript Array reverse() Method
The reverse() method reverses the order of the elements in an array. ... Get certified by completing a course today! ... If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: ... Your message has been sent to W3Schools. HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
W3Schools
w3schools.com › js › tryit.asp
W3Schools online HTML editor
The W3Schools online code editor allows you to edit code and view the result in your browser
🌐
Flexiple
flexiple.com › javascript › reverse-javascript-array
JavaScript: Reverse an array using different methods - Flexiple
March 11, 2022 - ... 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 each element to the new array arr1....
🌐
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.
🌐
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 ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › reverse-a-string-in-javascript
Reverse a String in JavaScript - GeeksforGeeks
At each step, we build a new string by adding the current character to the result. ... let name = "GeeksforGeeks"; let reverseString = ''; for (let i = name.length - 1; i >= 0; i--) { reverseString += name[i]; } console.log(reverseString);
Published   December 20, 2025
🌐
freeCodeCamp
freecodecamp.org › news › javascript-array-reverse-tutorial-with-example-js-code
JavaScript Reverse Array – Tutorial With Example JS Code
January 18, 2021 - This tutorial will show you five ways to reverse an array in JavaScript with and without the reverse method, along with code snippets that you can use.
🌐
Programiz
programiz.com › javascript › library › array › reverse
JavaScript Array reverse() (With Examples)
In this tutorial, you will learn about the JavaScript Array reverse() method with the help of examples. The reverse() method returns the array in reverse order.
🌐
JavaScript Tutorial
javascripttutorial.net › home › javascript array methods › array.prototype.reverse()
JavaScript Array Reverse
November 8, 2024 - In this tutorial, you will learn how to use the JavaScript array reverse() method that reverses the order of elements within an 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]);
    }