javascript-loops Flashcards
What is the purpose of a loop?
to repeat an action/code
What is the purpose of a condition expression in a loop?
sets the rules for the loop
What does “iteration” mean in the context of loops?
number of times the code runs
When does the condition expression of a while loop get evaluated?
before each pass through the loop
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 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 will break out of loop but not out of function
What does the ++ increment operator do?
increments the value
How do you iterate through the keys of an object?
for in loop