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.
Loading...
Related Quiz
- In NoSQL databases like MongoDB, how can you ensure data consistency across distributed databases?
- In a Cache-Aside strategy, when is the data loaded into the cache?
- You are developing an NPM package and are about to publish a version with experimental features. What is the semantic versioning compliant way to version this release?
- How does JavaScript handle implicit data type conversion?
- How can you secure sensitive information like API keys in your Express application?