0 votes
in JavaScript by
In JavaScript, what are the scopes of a variable?

1 Answer

0 votes
by

Scope of a variable means the region of your program within which it is defined. There are two scopes:

  1. Global Variables: A global variable has a global scope meaning that it will be visible everywhere within your code.
  2. Local Variables: Local variables will only be visible within the function in which it has been defined.
...