javascript-loops Flashcards
What is the purpose of a loop?
repeat a block of code exponentially quickly
What is the purpose of a condition expression in a loop?
how long to keep the loop going
What does “iteration” mean in the context of loops?
iteration is the number of times it runs
When does the condition expression of a while loop get evaluated?
before executing the statement
When does the initialization expression of a for loop get evaluated?
first before the loop starts
When does the condition expression of a for loop get evaluated?
second, after initialization, then again once loop runs
When does the final expression of a for loop get evaluated?
at the end of the code block
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?
increases by one
How do you iterate through the keys of an object?
for/in loop