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. 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).