Javascript Loops Flashcards
What is the purpose of a loop?
To repeat an action until the condition is completed
What is the purpose of a condition expression in a loop?
It describes what starts and stops a loop
What does “iteration” mean in the context of loops?
each run of the loop
When does the condition expression of a while loop get evaluated?
at the start of each loop
When does the initialization expression of a for loop get evaluated?
at the very start
When does the condition expression of a for loop get evaluated?
at the start and at the beginning of each loop
When does the final expression of a for loop get evaluated?
At the end of each loop
Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?
break
What does the ++ increment operator do?
adds 1 to the target
How do you iterate through the keys of an object?
with a for in loop