Run it through the debugger and it'll become clear.
i varies with each pass through the loop: 0, 1, 2, 3, 4
So the element you put the value into starts with teh first and moves on to teh second, and so on.
The value changes as well, but it starts with:
myArray[length -1 - 0]
And then uses
myArray[length -1 - 1]
And so forth.
So the if length is 5 (which is wrong for myArray - it should be 8) then the indexes you load from are 4, 3, 2, 1, 0
So element 0 becomes element 4: 2
Element 1 becomes element 3: 1
Element 2 becomes element 2: 6
Element 3 becomes element 1 (which has changed): 1
Element 4 becomes element 0 (which has changed): 2
Seriously: use the debugger and you'll see what I mean!