The _______ keyword in JavaScript is used to declare variables that are block-scoped.

  • var
  • let
  • const
  • block
The correct option is "let." In JavaScript, the "let" keyword is used to declare variables that are block-scoped, meaning they are limited to the block in which they are defined. This is different from the "var" keyword, which declares variables with function scope or global scope. "const" is used to declare constants, and "block" is not a valid keyword for variable declaration in JavaScript.
Add your answer
Loading...

Leave a comment

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