• Post author:
  • Post category:Blog
  • Reading time:1 mins read
  • Post last modified:June 12, 2024

In the daysOfWeek variable, we place an array with the names of the days of the week. To reverse the order of the array elements, we should call:

  • reverse daysOfWeek;
  • daysOfWeek.invert();
  • invert(daysOfWeek);
  • daysOfWeek.reverse();
Answers Explanation & Hints:

To reverse the order of the array elements stored in the daysOfWeek variable, you should call:

daysOfWeek.reverse();

The reverse() method is used to reverse the order of elements in an array in JavaScript. By calling daysOfWeek.reverse(), the elements in the daysOfWeek array will be reversed.

For more Questions and Answers:

JavaScipt Essentials 1 (JSE) | JSE1 – Module 2 Test Exam Answers Full 100%

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments