- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path31_local_scope.js
More file actions
Latest commit
25 lines (21 loc) · 562 Bytes
/
Copy path31_local_scope.js
File metadata and controls
25 lines (21 loc) · 562 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// local scope
// can't be acces from outside code blocks
// if - NOT VAR
constthisGlobal='Hello Global';
{
constname='hello world';
}
// name is not defined cz name is local scope
// console.log(name);
functioncallingMe(){
constname='john doe';
constage=25;
globalWorld='Hello World this Global';
}
// age is not defined cz age is local scope
// console.log(age);
// access function for print global without keyword
callingMe();
// globalWorld is not defined if not access function
console.log(globalWorld);
console.log(thisGlobal);