JS Loops Flashcards
What is the purpose of a loop?
to repeat the same, or similar, code a number of times
What is the purpose of a condition expression in a loop?
the boolean expression of the loop
What does “iteration” mean in the context of loops?
repetition of a function
When does the condition expression of a while loop get evaluated?
each loop iteration
When does the initialization expression of a for loop get evaluated?
as the loop begins
When does the condition expression of a for loop get evaluated?
before each loop iteration
When does the final expression of a for loop get evaluated?
end of each loop iteration
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
How do you iterate through the keys of an object?
for in loop