I was just having a play around with some code in LINQPad and noticed that on an int array there is a Reverse method.
Usually when I want to reverse an int array I'd do so with
Array.Reverse(myIntArray);
Which, given the array {1,2,3,4}
would then return 4
as the value of myIntArray[0]
.
When I used the Reverse()
method directly on my int array:
myIntArray.Reverse();
I notice that myIntArray[0]
still comes out as 1
.
What is the Reverse
method actually doing here?