-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
80 lines (72 loc) · 1.92 KB
/
script.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
74
75
76
77
78
79
80
var resumeData = {
"basics": {
"name": "CHANDRA BOSE.A",
"email": "chandrubose46@gmail.com",
"phone": "9952978290",
"degree": "B.TECH PETROLEUM ENGINEERING",
},
"location": {
"address":
"MIG-428,THNB,KAMARAJAR ROAD,FORD COMPANY BACKSIDE,MARAI MALAI NAGER",
"postalCode": "603204",
"city": "Chennai",
"state": "Tamilnadu",
"country": "India",
},
"profile": [
{
"github": "https://github.com/ChandraBose-11",
"Netlify": "https://app.netlify.com/teams/chandrabose-11/overview",
},
],
"education": [
{
"institution": "Vels Institute of Science, Technology & Advanced Studies",
"department": "Petroleum",
"studyType": "fulltime",
"batch start year": "2019",
"batch end year": "2023",
"gpa": "8.5",
},
],
"skills": [
{
"name": "html,css,javascript",
"level": "beginer",
},
],
"languages": [
{
"language": "Tamil,Enlish",
},
],
};
console.log(resumeData);
// --------------------->END <------------------------
// 2.For the above JSON iterate over all for loops (for, for in, for of, for Each)
console.log("Using for loop:");
for (var key in resumeData.basics) {
console.log(`${key}: ${resumeData.basics[key]}`);
}
console.log("\nUsing for...in loop:");
for (var key in resumeData.location) {
if (resumeData.location.hasOwnProperty(key)) {
console.log(`${key}: ${resumeData.location[key]}`);
}
}
console.log("\nUsing for...of loop:");
for (var value of Object.values(resumeData.profile)) {
console.log(value);
}
console.log("\nUsing forEach loop for education:");
resumeData.education.forEach((education) => {
console.log(education);
});
console.log("\nUsing forEach loop for skills:");
resumeData.skills.forEach((skills) => {
console.log(skills);
});
console.log("\nUsing forEach loop for languages:");
resumeData.languages.forEach((languages) => {
console.log(languages);
});