Thursday , September 19 2024

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:

Questions BankCategory: JavaScript Essentials 1If 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:
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