Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 609 Bytes

File metadata and controls

9 lines (6 loc) · 609 Bytes

Let vs. Var

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.

Resource - Let Resource - Var