Which keyword is used to declare a variable with block scope?
- let
- var
- const
- block
The let keyword is used to declare a variable with block scope in JavaScript. Variables declared with let are limited to the block or scope in which they are defined, which is typically within a pair of curly braces {}.
Loading...
Related Quiz
- Which HTTP status code represents a successful GET request?
- The _________ method is used to bind an object context to a function and is called immediately.
- How does the prototype property behave in arrow functions?
- The _______ method is used to handle errors in Promises.
- Which organization developed JavaScript?