javascript-loops Flashcards
What is the purpose of a loop?
Checks a condition until returns false
What is the purpose of a condition expression in a loop?
It tells the loop how many times to run
What does “iteration” mean in the context of loops?
Iteration is the repetition of a function or process in a computer program.
When does the condition expression of a while loop get evaluated?
An expression 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?
An expression to be evaluated before each loop iteration.
When does the final expression of a for loop get evaluated?
An expression to be evaluated at the 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 statement
What does the ++ increment operator do?
Takes the variable and adds one to it , then reassigns it
How do you iterate through the keys of an object?
For …in