-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
98 lines (84 loc) · 2.23 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
97
//Q.1.
const myResume={
"basics": {
"name": "Gurumoorthi T",
"email": "gurumcsnsk@gmail.com",
"phone": 9659070104,
"degree": "MSC-CS",
"location": {
"address": "Palladam",
"postalCode": 641664,
"city": "Palladam",
"state": "Tamilnadu",
"country": "India"
},
"profiles": [
{
"github":"https://github.com/Gurumoorthi1990"
}
]
},
"education": [
{
"institution": "RVS CAS",
"department": "Computer Science",
"studyType": "fulltime",
"batch start year": 2011,
"batch end year": 2012,
"CGPA": 7.8,
}
],
"skills": [
{
"name": "javascript",
"level": "beginer",
}
],
"languages": [
{
"language": "Tamil,Enlish",
}
],
"interests": [
{
"name": "travelling",
}
]
}
console.log(myResume);
//Question 2:
//for the given JSON iterate over all for loops
//2nd loop
//for loop
var mydetails1 = [{
"Name":"Gurumoorthi T",
"Age":34,
"Degree":"MSC",
"Address":"Palladam",
"Number":"+919659070104"
}]
for(var i=0;i<mydetails1.length;i++){
console.log(mydetails1[i]);
}
/*******************************************/
//for in loop
var mydetails = {
"Name":"Gurumoorthi T",
"Age":34,
"Degree":"MSC",
"Address":"Palladam",
"Number":"+919659070104"
};
for (var i in mydetails){
console.log(i,mydetails[i]);
}
/************************************************/
//3rd for of loop:
const result23 = [60,80,90,96,95]
for(var newresult23 of result23){
console.log(newresult23);
}
/*******************************************/
//4th for each loop
var result24 = [99,100,100]
result24.forEach(numbers=>{console.log(numbers)});