If we want to display all the elements of the
days
array in reverse order (starting from the last element) then we can do this using the statement:
for(let i = days.length; i > 0; i--) console.log(days[i]);
for(let i = days.length - 1; i >= 0; i--) console.log(days[i]);
for(let i = days.length - 1; i > 0; i--) console.log(days[i]);
for(let i = days.length; i > 0; i--) console.log(i);
More Questions: JavaScript Essentials 1 – JSE1: Module 4 Test
Please login or Register to submit your answer