Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ab3d9be

Browse files
authored
Add Global scope
1 parent b333262 commit ab3d9be

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

‎README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,30 @@ console.log(multiply(5,10)) // 50
2626
## Scope
2727

2828
* Global scope
29-
* Local Scope
29+
* Local scope
3030
* Function scope
3131
* Block scope
32-
* Function hoisting and scopes
33-
* Functions do not have access to each other's scopes
34-
* Nested scopes
32+
* Function hoisting and scope
33+
* Functions do not have access to each other's scope
34+
* Nested scope
35+
36+
**Global scope**
37+
38+
If a variable is declared outside all functions or curly braces `({})`, it is said to be defined in the global scope.
39+
40+
```javascript
41+
const globalVariable = 'some value';
42+
```
3543

3644
## Closure
3745

3846
Clousure is the functions that have access to the parent scope, even when the parent function has closed.
3947

4048
For every closure there are 3 scopes:
4149

42-
* Local Scope ( Own scope)
43-
* Outer Functions Scope
44-
* Global Scope.
50+
* Local scope ( Own scope)
51+
* Outer functions scope
52+
* Global scope
4553

4654
## Function Delegates
4755

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /