javascript-while Flashcards
1
Q
What is the purpose of a loop?
A
repeat the same, or similar, code a number of times. Lets you repeat functionality based on the code block within loop,.
2
Q
Why might there be different kinds of loops?
A
Because you may be unsure how many times you want to run the loop.
3
Q
What is the purpose of a conditional expression as it relates to loops?
A
It sets the amount of times the loop will run.
4
Q
Could a loop potentially go on forever?
A
Yes, depending on the condition.
5
Q
Could a loop never start?
A
Yes, depending on the condition.