Contact: aviboots(AT)netvision.net.il
39,043 questions
50,760 answers
573 users
const arr = [4, 8, 1, 0, 9, 7, 3, 2]; for (let i = arr.length - 1; i >= 0; i--) { console.log(arr[i]); } /* run: 2 3 7 9 0 1 8 4 */
const arr = [4, 8, 1, 0, 9, 7, 3, 2]; arr.slice().reverse() .forEach(function(item) { console.log(item); }); /* run: 2 3 7 9 0 1 8 4 */
const arr = [4, 8, 1, 0, 9, 7, 3, 2]; arr.reduceRight((_, item) => console.log(item), null); /* run: 2 3 7 9 0 1 8 4 */