Loops Flashcards

1
Q

Definition

A

Repeating actions for a specific amount of time.

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

For Loops

A

var num = 5;

for(var i = num; i >= 1; i–)
{
print(i);
}

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

For In Loop

A

var names = [“John”, “Tina”, “Steve”];
for (var name in names){
print(name);
}

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

While Loop

A

while(num >= 1){
print(num);
i–;
}

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