ForStatement
ForStatement is a looping construct used to repeat a block of code a controlled number of times. In many languages it is represented in the language grammar as a for loop with an initializer, a loop condition, and an update expression executed after each iteration. In the ECMAScript specification, ForStatement corresponds to the standard for loop syntax: for (init; test; update) statement.
Syntax and components: init initializes the loop variable (it can be a variable declaration or an expression
Semantics: The loop begins by evaluating init once. If test is present and evaluates to true, the
Variants: ForStatement is distinct from ForInStatement and ForOfStatement in JavaScript, which iterate over object property names
Examples: for (let i = 0; i < 10; i++) { … } and for (var i = 0; i < n; i
See also: While loop, Do-While loop, ForInStatement, ForOfStatement.