-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
96 lines (82 loc) · 1.86 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! (1) Resume with JSON
let myResume={
"basics": {
"name": "RAGURAM R R ",
"email": "raguramraja11@gmail.com",
"phone": "987654321",
"degree": "B.E",
"location": {
"address": "1B/1,TVS Street,Rasipuram",
"postalCode": "637408",
"city": "Namakkal",
"state": "Tamilnadu",
"country": "India"
},
"profiles" : {
"github":"https://github.com/RaguramRR"
}
},
"education": [
{
"institution": "Mahendra Engineering college",
"department": "Mechanical",
"studyType": "fulltime",
"batch start year": "2015",
"batch end year": "2019",
"gpa": "8.56",
}
],
"skills": [
{
"name": "javascript",
"level": "beginer",
}
],
"languages": [
{
"language": "Tamil,Enlish,malayalam",
}
],
"interests": [
{
"int": "books reading,football,youtuber,",
}
]
}
console.log(myResume);
//! (2) iterate over all for loops
var json = [{
"id" : "Raguram",
"institution": "Mahendra Engineering college",
"language": "Tamil,Enlish,malayalam",
"mail": "raguramraja11@gmail.com"
},
{
"id" : "Raguram",
"institution": "Mahendra Engineering college",
"language": "Tamil,Enlish,malayalam",
"mail": "raguramraja11@gmail.com"
}];
//! for loop
for(var i = 0; i < json.length; i++) {
var obj = json[i];
console.log(obj.id);
console.log(obj.institution);
console.log(obj.language);
console.log(obj.mail);
}
//! for Each
json.forEach(function(obj) { console.log(obj.language); });
//! for In
for (var key in json) {
if (json.hasOwnProperty(key)) {
console.log(json[key].id);
//console.log(json[key].msg);
}
}
//! for Of
let text = "";
for (let x of json[key].id) {
text += x;
}
console.log(text);