The for statement creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement or a set of statements executed in the loop.
The for loop has the following syntax:
for (<ahref='http://forum.freecodecamp.com/t/javascript-while-loop/14668'target='_blank'rel='nofollow'>initialization]; [condition]; [final-expression]) {
For loops are used to loop through a block of code for a known number of times. Sometimes only the computer knows how many times the loop will occur, not you, either way it is still known.