javascript-loops Flashcards
What is the purpose of a loop?
The purpose of loops is to repeat the same, or similar, code a number of times.
What is the purpose of a condition expression in a loop?
Checks condition for truthfulness before executing any of the code in the loop.
What does “iteration” mean in the context of loops?
Iteration is a process wherein a set of instructions or structures are repeated in a sequence a specified number of times or until a condition is met.
When does the condition expression of a while loop get evaluated?
before every iteration
When does the initialization expression of a for loop get evaluated?
it is the first step
When does the condition expression of a for loop get evaluated?
before every iteration
When does the final expression of a for loop get evaluated?
after each 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?
add one to a number
How do you iterate through the keys of an object?
for in loop