-
Notifications
You must be signed in to change notification settings - Fork 7
/
day3.js
190 lines (117 loc) · 2.25 KB
/
day3.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// swicth case
// let statusVal = 2;
// switch(statusVal)
// {
// case 1:
// {
// console.log("Super User");
// break;
// }
// case 2:
// {
// console.log("Medium User");
// break;
// }
// case 3:
// {
// console.log("Normal user");
// break;
// }
// default:
// {
// console.log("Lower Level User");
// }
// }
// if(statusVal===1)
// {
// console.log("Supr User");
// }
// else if(statusVal===2)
// {
// console.log("Medium User")
// }
// else
// {
// console.log("Lower level user");
// }
// let voteStatus=null;
// let age=16;
// if(age>=18)
// {
// sfkhv
// dsfh
// dsfhk
// }
// else
// {
// voteStatus=2;
// }
// condn ? correctVal : falseValue
// let age=24;
// let voteStatus = age>=18 ? 1 : 2;
// console.log(voteStatus);
// loops
// set of code which executes itself again and again based on a condition
// loop (condn)
// {
// //code
// }
// while
// do while
// for
// let a = 1;
// while(a<10)
// {
// console.log("letsupgrade "+a);
// a++;
// }
// let a=14;
// do
// {
// console.log("Letsupgrade "+a);
// a++;
// }
// while(a<10);
// for(let a=1 ; a<=10 ; a++)
// {
// console.log("Letsupgrade "+a);
// }
// console.log("Outside code");
// array
// collection of elements / data of same type stored in a single variable
// let city = "Mumbai";
// let city1 = "Pune";
// let city2 = "hyderabad";
let cities = [34,56,78,56,78];
cities[4]=67;
// console.log(cities);
// console.log(cities[1]);
// console.log(cities[2]);
// for(let a=0;a<cities.length;a++)
// {
// console.log(cities[a]);
// }
// objects
// collection of proerties/data which is representing a single enetity
// let name="Saurabh";
// let age=27;
// let city="Mumbai";
// let name2="Sravani";
// let age2=21;
// let city2="Hyderabad";
let student1 = {
name:"Saurabh",
age:27,
city:"Mumbai"
}
student1.age=45;
// console.log(student1.age);
// console.log(student1.name);
console.log(student1);
let student2={
name:"Sravani",
age:21,
city:"Hyderabad"
}
console.log(student2.city);
//code