-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-6.js
More file actions
50 lines (42 loc) · 1.29 KB
/
Copy pathtest-6.js
File metadata and controls
50 lines (42 loc) · 1.29 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
Memory:
==> 2 types:
1. Stack{Primitive}[Copies Value],
2. Heap{Non-Primitive}[Reference Value]
*/
// Stack{Primitive}[Copies Value] :
/*
let myYoutubename = "Arafatdotcom"
let anotherChannel = myYoutubename
anotherChannel = "Arfandotcom"
// console.log(anotherChannel);
// console.log(myYoutubename);
// Heap{Non-Primitive}[Reference Value] :
let userOne = {
email: "usergoogle.com",
upi: 'userbl'
}
let userTwo = userOne
userTwo.email = "arafaatdotcom"
// console.log(userOne.email);
// console.log(userTwo.email);
*/
let myYoutubeName = "Arafatdotcom"
let anotherChannel = myYoutubeName // " ReferenceError: myYoutubeName is not defined " ==>If I commented {" let myYoutubeName = "Arafatdotcom" "}
anotherChannel = "Arfandotcom"
console.log(anotherChannel);
console.log(myYoutubeName);
console.table([myYoutubeName,anotherChannel]);
let myObjectOne = {
email: "usergoogle.com",
upi: 'userbl'
}
let myObjectTwo = myObjectOne
myObjectTwo.email = "bakibullahdotcom"
myObjectTwo.upi = "hyapi.BL"
console.log(myObjectOne.email);
console.log(myObjectTwo.email);
console.log(myObjectOne.upi);
console.log(myObjectTwo.upi);
console.table([myObjectOne,myObjectTwo]);
console.table([myYoutubeName,anotherChannel,myObjectOne,myObjectTwo]);