Search notes:

JavaScript - Variable declaration statements: var and let

The var and let statements declare variables.
The var statement declares a variable that is scoped to the running execution context's variable-environment. In a browser environment, but not in Node.js, that means that the variable is created as a property in the global object.
The let (and const) statements declare (define) a variable that is scoped to the running execution context's lexical environment (and thus is not created as property in the global object).

Index