JavaScript Loops Flashcards
What is the purpose of a loop?
to perform repeated tasks based on a condition
What is the purpose of a condition expression in a loop?
it is an expression that is constantly checked to determine whether the loop should be executed
What does “iteration” mean in the context of loops?
When the first set of instructions is executed again
When does the condition expression of a while loop get evaluated
The condition is evaluated before executing the statement
When does the initialization expression of a for loop get evaluated?
before the execution of the first loop
When does the condition expression of a for loop get evaluated?
An expression to be evaluated before each loop iteration
When does the final expression of a for loop get evaluated?
After all the loop iterations
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?
It increase the variable it is used on by 1
How do you iterate through the keys of an object?
for( ___ in ___)