-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObject3.js
73 lines (49 loc) · 1.12 KB
/
Object3.js
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*const person ={
name : "shaista",
age : 25,
location : "Kashmir"
};
console.log(person);
const person = new Object ();
person.name = "shaista";
person.age =25;
person.location = "Kashmir";
console.log(person);
const person = new Object ();
person.name = "shaista";
person.age = 25;
person.location = "Kashmir";
console.log(person);
const person = new Object();
person.name = "shaista";
person.age = 25;
person.location = "Kashmir";
console.log(person);
console.log(person.name);
person.hobby = "Reading";
console.log(person);
person.skills = "programming";
console.log(person);
delete person.hobby;
console.log(person);
const person ={
name : "shaista",
greet : function(){
return `Hello , My name is ${this.name}`;
}
};
console.log(person.greet());
*/
const person ={
name : "shaista",
greet : function (){
return `hello, my name is ${this.name}`;
}
};
console.log(person.greet());
for (let key in person ){
console.log(`${key} : ${person[key]}`);
}
console.log(Object.keys(person));
console.log(Object.values(person));
console.log( Object.fromEntries(person));