-
Notifications
You must be signed in to change notification settings - Fork 0
/
json.js
48 lines (34 loc) · 1.2 KB
/
json.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
// const friends = [
// {name: "Shibbir", phone : 123456},
// {name: "Niloy", phone : 123465},
// {name: "Rakib", phone: 1321456},
// {name: "Anyone", phone: 231456}
// ]
// const userJSON = JSON.stringify(students);
// console.log(userJSON);
// const userFromJSON = JSON.parse(userJSON);
// console.log(userFromJSON)
// const userData = userFromJSON.map(name => name.name);
// console.log(userData)
// const friends = [
// {name: "Shibbir", phone : 123456},
// {name: "Niloy", phone : 123465},
// {name: "Rakib", phone: 1321456},
// {name: "Anyone", phone: 231456}
// ]
// const userJSON = JSON.stringify(friends);
// console.log(userJSON);
// const userFromJSON = JSON.parse(userJSON);
// const userNameFromJSON = userFromJSON.map(name => name.name)
// console.log(userNameFromJSON)
const friends = [
{fdname: "Olil", phone: 1234123},
{fdname: "Jolil", phone: 3523523},
{fdname: "Kholil", phone: 3532123},
{fdname: "Molil", phone: 2353252}
]
const friendsJSON = JSON.stringify(friends);
const friendsDataFromJSON = JSON.parse(friendsJSON);
console.log(friendsDataFromJSON);
const friendsName = friendsDataFromJSON.map(name => name.fdname);
console.log(friendsName)