In JavaScript, variables declared using the var keyword are hoisted to the top of their ________.

  • scope
  • function
  • declaration
In JavaScript, variables declared using the var keyword are hoisted to the top of their containing function's scope. This means that they are moved to the top of the function during the compilation phase, allowing you to use them before they are declared in the code.
Add your answer
Loading...

Leave a comment

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