Which of the following is true regarding the 'let' keyword in ES6+?

  • let variables are hoisted to the top of their scope.
  • let variables are block-scoped.
  • let variables are globally scoped.
  • let variables cannot be reassigned after declaration.
In ES6+, the let keyword is used to declare variables that are block-scoped, meaning they are limited to the block in which they are declared. Unlike var, let variables are not hoisted to the top of their scope. They can also be reassigned after declaration.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *