The scope of a declaration is the part of code where the declared variable can be referenced.
- The scope of a local variable is from the point of declaration to the end of the enclosing function (or block).
- The scope of a variable declared in the initialization part of a for loop is the body of the for loop.