That is the scope of a variable is the region of your program in which it is defined. JavaScript variable will have only two scopes.
Global Variables in Javascript − The global variable has a global scope which means this is visible everywhere in your JavaScript code.
Local Variables in Javascript − The local variable will be visible only within a function where it is defined. The function parameters are always local to that function.
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
That is the scope of a variable is the region of your program in which it is defined. JavaScript variable will have only two scopes.
Global Variables in Javascript − The global variable has a global scope which means this is visible everywhere in your JavaScript code.
Local Variables in Javascript − The local variable will be visible only within a function where it is defined. The function parameters are always local to that function.