Understanding variable scopes in Javascript - GeeksforGeeks
Understanding variable scopes in Javascript
In JavaScript, there are two types of scopes
- Global Scope – Scope outside the outermost function attached to Window
- Local Scope – Inside the function being executed
Let's look at the code below. We have a global variable defined in first line in global scope. Then we have a local variable defined inside the function fun().
Read full article from Understanding variable scopes in Javascript - GeeksforGeeks
No comments:
Post a Comment