javascript-loops Flashcards
What is the purpose of a loop?
Repeat a block of code automatically.
What is the purpose of a condition expression in a loop?
It determines if and when the loop stops.
What does “iteration” mean in the context of loops?
Means how many times the loop will loop.
When does the condition expression of a while loop get 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 loop iteration.
When does the final expression of a for loop get evaluated?
At the end of every 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?
Adds one to the operand.
How do you iterate through the keys of an object?
Using the for in statement.