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 {}.
Add your answer
Loading...

Leave a comment

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