Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reversing an array

const list = [1,2,3,4,5];
list.reverse(); // It changes the original array

console.log('reversed:', list);
// expected output: "reversed:" Array [5, 4, 3, 2, 1]
Source by www.programcreek.com #
 
PREVIOUS NEXT
Tagged: #reversing #array
ADD COMMENT
Topic
Name
9+7 =