Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reverse array elements in javascript

// reverse array elements in javascript
const arr = ["first", "second", "third"];
arr.reverse(); // Mutates the array
console.log(arr); // ["third", "second", "first"]
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #reverse #array #elements #javascript
ADD COMMENT
Topic
Name
8+6 =