JS loops Flashcards
What is the purpose of a loop?
perform repeated tasks
What is the purpose of a condition expression in a loop?
to determine when to continue and when to end
What does “iteration” mean in the context of loops?
process/point in time when the code is executed
When does the condition expression of a while loop get evaluated?
The condition is evaluated before each iteration.
When does the initialization expression of a for loop get evaluated?
once before the loop begins
When does the condition expression of a for loop get evaluated?
before each iteration
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?
add one to the current value of the variable
How do you iterate through the keys of an object?
for..in loop