I cannot seem to understand the mechanism of how the array is reversed. Would someone please elaborate why we are making these changes in particular to get a reversed loop?
We need to make three changes to our for loop:
Edit the start condition to set the index equal to the length of the variable array minus one.
Then, set the stop condition to when the variable is greater than or equal to 0.
Finally, change index++ to index-- to subtract 1 from the iterator variable each loop.