Converts a forEach loop that iterates over an array with an equivalent for loop that uses an index to iterate over the array.