JavaScript by Patrik

Let in JavaScript

The let keyword was introduced in ES6 (2015).

Scope

  • Block scoped always
  • Start to end of the current scope anywhere

Redeclaration

  • No, can't redeclare in the same scope

Hoisting

  • Hosted at top of some private scope and only available after assigning value
  • Can not be used before the declaration

Comments