Skip to content

Commit 83a9f54

Browse files
committed
Add initial JavaScript functions and execution context notes
1 parent 62fbd93 commit 83a9f54

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

main.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+

notes.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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.

0 commit comments

Comments
 (0)