Your question title and the code in the question don't match.
The answer to your question in the title is: how else would you find a value? Unless you have some extra knowledge about the structure of the array, iterating it is the only way to find a value. If you do know something extra, e.g. that the array is sorted, then you can do something more efficient, e.g. binary search. But in the worst-case, you need to iterate over the entire array, in the average case, over half the array.
Now, about the code you posted: this code isn't trying to find a value. It's not trying to find anything, really. It already knows the indices it wants to work on, there is no need at all to iterate.
Sometimes, there are legitimate reasons to do extra work, though. For example, in security-sensitive applications, the time it takes to do some work may leak information about the data. (This is called a timing attack, which is a special case of the more general class of side-channel attacks.) For example, a string comparison will usually abort and return
false as soon as it finds the first difference between strings. However, this means that an attacker can, e.g. determine how many characters at the beginning of the password he guessed correctly, thus reducing the complexity of brute-forcing the password from ** (i.e. exponential complexity) to * (i.e. polynomial complexity).
So, this would be an example, where you always need to loop through the entire array and cannot abort early, because you need to spend the same time regardless of where the difference occurs.
This doesn't appear to be the case here, though.