Statements Flashcards

1
Q

If () {

}

A

If the logic expression is true, only then will the statements be executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

If () {

} else {

}

A

If the logic expression is true, only then will the first statements be executed, if false, then the second set will be executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If () {

} else if () {

} else {

}

A

If the logic expression is true, only then will the statements be executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Switch

A

Switch a pre defined value for another when requested

function day_of_week_(day) {
switch(day){
case 1: return “Monday”;
case 2: return “Tuesday”;
}}

day_of_week(1)
“Monday”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

While

A
var i= 1;
while (i<=10){
console.log(i);
i++;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

for

A
for(var i =0; i <=100; i++) {
console.log(i);
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

break

A
for(var i =0; i <=100; i++) {
if (i==6){break;}
console.log(i);
}

Will stop at 7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Continue

A
for(var i =0; i <=100; i++) {
if (i ==8){
continue;}
console.log(i);
}

8 will not be shown

How well did you know this?
1
Not at all
2
3
4
5
Perfectly