In JavaScript, variables declared with the var keyword have _________ scope.

  • Block
  • Local
  • Global
  • Function
In JavaScript, variables declared with the var keyword have global scope. This means they are accessible throughout the entire function or script, regardless of where they are declared within that function or script. It's important to be cautious when using var to avoid unintended global variable declarations.
Add your answer
Loading...

Leave a comment

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