Disregard previous comment, I checked and it seems I was thinking of behaviour of for loop in different language.