Skip to content

Commit ddf7f7d

Browse files
committed
obj pt 2 and obj-destructure
1 parent 9f53432 commit ddf7f7d

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

02_basics/04_object.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,32 @@ console.log(Object.entries(tinderUser));
5151
// Object.hasOwnProperty--> Determines whether an object has a property with the specified name
5252
console.log(tinderUser.hasOwnProperty('isLoggedIn'));
5353

54+
///***************************OBJECT de-Structure and JSON API intro */
5455

56+
const player={
57+
playername:"Raj Shekhar",
58+
teamname:"SuperStrikers",
59+
position:"forward"
60+
}
61+
62+
//another method to access the vcalue of object
63+
64+
const{playername}=player
65+
66+
console.log(playername);
67+
68+
//******* JSON --> JavaScript Object Notation*/
69+
70+
71+
// {
72+
// "name":"Raj Shekhar",
73+
// "coursename":"js in hindi",
74+
// "price":"free"
75+
76+
// }
77+
78+
[
79+
{},
80+
{},
81+
{},
82+
]

0 commit comments

Comments
 (0)