-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprop_type.js
More file actions
44 lines (37 loc) · 919 Bytes
/
Copy pathprop_type.js
File metadata and controls
44 lines (37 loc) · 919 Bytes
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
const { object, objectOf } = require("prop-types");
let post = {}
console.log(post);
post.title = "Hello I'm post title";
console.log(post);
const person = {
name: "Md.Bozlur Rosid Sagor",
address: {
country: "Bangaldesh",
city: "Gaibandha",
}
};
console.log(person);
const new_object = Object.assign({}, person, { name: "Mbr Sagor", age:25});
console.log(new_object);
const update = { ...person, name:"Bozlur Rosid"}
console.log(update);
update.address.city = "Dhaka, Uttara";
// print pure person object
console.log(person);
let address = {
name: 'mbr-sagor',
phone_number: '+8801773474709',
road: 'Uttra Sector#10, Road#10/B',
house: 12
}
/**
*
for (let index = 0; index < address.length; index++) {
const element = address[index];
console.log(element);
}
*
*/
for (const [key, val] of Object.entries(address)) {
console.log(`${key}: ${val}`);
}