ELI5: Explain Like I'm 5

loop invariant

A loop invariant is something that remains true in a loop. It’s like a rule that always stays the same even if other things in the loop change. For example, if you have a loop that goes through a set of numbers, the loop invariant could be that the total of all the numbers will stay the same no matter which numbers you add or take away from the set.