Loops Flashcards
1
Q
Definition
A
Repeating actions for a specific amount of time.
2
Q
For Loops
A
var num = 5;
for(var i = num; i >= 1; i–)
{
print(i);
}
3
Q
For In Loop
A
var names = [“John”, “Tina”, “Steve”];
for (var name in names){
print(name);
}
4
Q
While Loop
A
while(num >= 1){
print(num);
i–;
}