Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript loop backwards through array

ar arr = [1, 2, 3, 4, 5];
 
Object.keys(arr).reverse()
        .forEach(function(index) {
            console.log(arr[index]);
        });
Source by www.techiedelight.com #
 
PREVIOUS NEXT
Tagged: #javascript #loop #array
ADD COMMENT
Topic
Name
1+7 =