-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12_object2.js
More file actions
55 lines (46 loc) · 1.09 KB
/
12_object2.js
File metadata and controls
55 lines (46 loc) · 1.09 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
51
52
53
54
55
// const tinder = new Object() // singleton object
const tinder = {}
tinder.id = "123abc"
tinder.name = "Rishav"
tinder.isLoggedIn = false
// console.log(tinder);
const another_user = {
email: "rox@chatgpt.com",
fullname: {
userfullname: {
firstname: "Roxx",
lastname: "Hound"
}
}
}
console.log(another_user.fullname.userfullname.firstname);
const obj1 = {1: "a" , 2: "b"}
const obj2 = {3: "c" , 4: "d"}
// const add = Object.assign({},obj1,obj2)
// const add = {...obj1, ...obj2} // spread method
// console.log(add);
const database = [
{
id: 1,
email: "hero@gmail.com"
},
{
id: 2,
email: "her@gmail.com"
},
{
id: 3,
email: "he@gmail.com"
},
{
id: 4,
email: "h@gmail.com"
}
]
database[1].email
console.log(database[0].email);
console.log(Object.values(tinder));
console.log(Object.keys(tinder));
console.log(Object.keys(database));
console.log(Object.values(database));
console.log(tinder.hasOwnProperty('isLoggedIn'));