Loop variable updates the array when assigned to and gives the value when referenced