File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+
2+
3+ // getName(); //namaste om
4+ // console.log(x); //undefined
5+ // console.log(getName) //[function : getName]
6+
7+ var x = 7 ;
8+ function getName ( ) {
9+ console . log ( "Namaste om" )
10+ }
11+
12+
13+ // getName(); //namaste om
14+ // console.log(x); // 7
15+ console . log ( getName ) //[function : getName] 1 functon
16+
17+
18+ console . log ( getName2 ) ; //undef 2nd function
19+ // getName2(); //get name 2 is not a function
20+
21+ var getName2 = ( ) => {
22+ console . log ( "Namaste again" ) ;
23+ }
24+
25+
26+ //Interview tip ->
27+ // Explain this thing
28+
29+
30+
Original file line number Diff line number Diff line change 1+ Everything in javascript happen inside as Execution context
2+ That whole thing is called as execution context inside that there two things
3+ 1.Memory component
4+ 2.Code component
5+ In memory component variable and functions values can be stored in a key value format.
6+ Code component is a place where whole JavaScript code is executed
7+ Memory component is also called as variable environment
8+ And code component is also called as thread of execution.
You can’t perform that action at this time.
0 commit comments