There are some subtle differences — let scoping behaves more like variable scoping does in more or less any other languages.
e.g. It scopes to the enclosing block, They don't exist before they're declared, etc.
However it's worth noting that let is only a part of newer Javascript implementations and has varying degrees of browser support.
olliej
- 36.9k
- 9
- 61
- 55