Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reverse through a for loop js

// Looping through reversely in a loop 
var arr = [ 1,2,3,4,5];

for (let i = arr.length-1; i>=0; i--){
     console.log(i);
}

//output = 5,4,3,2,1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #reverse #loop #js
ADD COMMENT
Topic
Name
9+7 =