for loop backwards code example
Example 1: python for loop backwards
for i in range(len(item)-1, -1, -1):
print(item[i])
Example 2: Count Backwards With a For Loop
var myArray = [];
for (var i = 9; i > 0; i -= 2){
myArray.push(i);
}
console.log(myArray); // console output [ 9, 7, 5, 3, 1 ]
Example 3: reverse for loop
for (int i = myArray.Length - 1; i >= 0; i--)
{
// Do something ...
}