Loops are a way to repeat code. They don’t always have to repeat that code on elements of an array, but that is a common situation in which they are used. Check out these different versions of loops:
There are other loops, like foreach and for…in, but the most useful ones are for and while.