Let allows you to declare variables that are limited in scope to the block, statement, or expression on which it is used. This is unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope.
Var declarations, wherever they occur, are processed before any code is executed. This is called hoisting, and is discussed further below.