Used in programming, loops are a sequence of script which is repeated until a defined condition is reached. The four main types of loop include for loops, while loops, do-while loops and for-each loops.
A while loop continues to repeat through a section of code as long as a specified condition is true. We use a while loop when we do not know the amount of times before-hand.
Similar to a while loop, however a “for loop” repeats a block of code for a specified amount of times. Used when you have an understanding of how many times you want to repeat the code.