Answers for "js loop in reverse"

C#
38

js loop array backwards

let arr = [1, 2, 3];
arr.slice().reverse().forEach(x => console.log(x))
Posted by: Guest on November-03-2021
1

javascript loop through using reverse for-loop

var arr = [1, 2, 3, 4, 5];
 
for (var i = arr.length - 1; i >= 0; i--) {
    console.log(arr[i]);
}
Posted by: Guest on April-06-2022
8

how to reverse loop in javascript

const array = [6,7,8,9,10];
for (const number of array.reverse()) {
    console.log(number);
}
Posted by: Guest on March-25-2020

C# Answers by Framework

Browse Popular Code Answers by Language