You can use slice() to make a copy then reverse() it

var newarray = array.slice().reverse();

var array = ['a', 'b', 'c', 'd', 'e'];
var newarray = array.slice().reverse();

console.log('a', array);
console.log('na', newarray);

Answer from Arun P Johny on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › reverse
Array.prototype.reverse() - JavaScript - MDN Web Docs
js · reverse() None. The reference to the original array, now reversed. Note that the array is reversed in place, and no copy is made. The reverse() method transposes the elements of the calling array object in place, mutating the array, and returning a reference to the array.
🌐
W3Schools
w3schools.com › jsref › jsref_reverse.asp
JavaScript Array reverse() Method
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 ·
Discussions

Reverse an array in JavaScript without mutating the original array - Stack Overflow
Array.prototype.reverse reverses the contents of an array in place (with mutation)... Is there a similarly simple strategy for reversing an array without altering the contents of the original array ( More on stackoverflow.com
🌐 stackoverflow.com
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
Making an independent copy of a reversed array in JavaScript - Stack Overflow
The second array I make pointOrigins2 is not an independent copy of pointOrigins1. In other words modifying pointOrigins2 is also modifying pointOrigins1 which is not what I need to achieve. From my reading on StackOverflow I have tried a few options such as using slice or using a for loop however nothing seems to be working yet so I made a fiddle. Is there a way to make an independent copy of the reversed ... More on stackoverflow.com
🌐 stackoverflow.com
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
🌐
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.
🌐
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 of Array instances is the copying counterpart of the reverse() method. It returns a new array with the elements in reversed order. js · toReversed() None. A new array containing the elements in reversed order. The toReversed() method transposes the elements of the calling ...
🌐
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 - Using a for loop (or any other type of loop), we can loop through an array from the last time to the first item, and push those values to a new array which becomes the reversed version.
🌐
GeeksforGeeks
geeksforgeeks.org › reverse-an-array-in-javascript
Reverse an Array in JavaScript | GeeksforGeeks
January 20, 2025 - The spread operator creates a shallow copy of the original array. The reverse() method is applied to the copied array, leaving the original array intact.
Find elsewhere
🌐
Melvin George
melvingeorge.me › blog › reverse-array-without-mutating-original-array
How to reverse the array without mutating the original array in JavaScript? | MELVIN GEORGE
December 8, 2020 - To reverse an array without mutating the original array in JavaScript. First, we can use the slice() method on the array to create a copy of the array and then use the reverse() method on that array to reverse the elements or items in the array.
🌐
SamanthaMing
samanthaming.com › tidbits › 74-how-to-reverse-an-array
How to reverse an array in JavaScript? | SamanthaMing.com
const originalArray = ['a', 'b', 'c']; const newArray = originalArray.reverse(); console.log(originalArray); // [ 'c', 'b', 'a' ] console.log(newArray); // [ 'c', 'b', 'a' ] Here are some recipes that won't mutate the original array.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › TypedArray › reverse
TypedArray.prototype.reverse() - JavaScript - MDN Web Docs
js · reverse() None. The reference to the original typed array, now reversed. Note that the typed array is reversed in place, and no copy is made. See Array.prototype.reverse() for more details. This method is not generic and can only be called on typed array instances.
🌐
Joe Attardi
joeattardi.dev › how-many-ways-can-we-reverse-an-array
How many ways can we reverse an Array? - Joe Attardi
November 23, 2022 - Array.prototype.slice will create a shallow copy of the array. This means that the references to each array element is copied into a new array. Reversing this copy mutates the new array by reordering items, but won't affect the ordering of the original array, or modify any of its elements.
🌐
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'] How do I check if an array contains a value in JavaScript? ... How do I send a POST request using JavaScript? How to send Bearer Token with JavaScript Fetch API? How do I fetch JSON using JavaScript Fetch API?
🌐
Linux Hint
linuxhint.com › reverse-an-array-in-javascript
How to Reverse an Array in JavaScript
October 10, 2021 - Linux Hint LLC, [email protected] 1210 Kelly Park Circle, Morgan Hill, CA 95037 Privacy Policy and Terms of Use
🌐
Stack Abuse
stackabuse.com › reverse-an-array-or-list-in-javascript
Reverse an Array in JavaScript
March 7, 2023 - By removing the last element and adding it as the first into a new array, we create a new reversed array. The first approach deals with a frozen copy of the numArr object, and thus doesn't modify the original array.
🌐
Vultr Docs
docs.vultr.com › javascript › standard-library › Array › reverse
JavaScript Array reverse() - Reverse Array Order | Vultr Docs
September 27, 2024 - The original array is mutated—this means that any other references to the original array also reflect the reversed changes. To prevent mutation of the original array, you can first make a copy of the array and then apply reverse().
🌐
Sonar
sonarsource.com › blog › es2023-new-array-copying-methods-javascript
ES2023 introduces new array copying methods to JavaScript | Sonar
May 10, 2023 - The methods toSorted, toReversed, toSpliced, and with allow you to perform operations on arrays by without changing the data in place, but by making a copy and changing that copy. Read on to learn the difference and how to start using them in your projects. The Array object has always had some oddities. Methods like sort, reverse, and splice change the array in place.
🌐
Futurestud.io
futurestud.io › tutorials › how-to-reverse-an-array-in-javascript-and-node-js
How to Reverse an Array in JavaScript and Node.js
May 26, 2022 - When reversing an array in JavaScript you may want to keep the original array “as is”. You can copy an existing array using the spread operator, the concat or slice methods.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › slice
Array.prototype.slice() - JavaScript - MDN Web Docs
The slice() method of Array instances returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included) where start and end represent the index of items in that array. The original array will not be modified.