- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path13_object.js
More file actions
Latest commit
23 lines (20 loc) · 482 Bytes
/
Copy path13_object.js
File metadata and controls
23 lines (20 loc) · 482 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// objects - key/value pairs methods
// dot notation
constperson={
name: 'dncode',
age: 25,
hobby: ['manga','programming','read book'],
married: false,
itsMe(){
return'hello its me '+person.name;
},
};
// access obj
console.log(person.name);
console.log(person.itsMe());
// for acces array on obj same use index
console.log(person.hobby[2]);
// u can reassign again on obj
person.name='john doe';
console.log(person.name);
console.log(person.itsMe());