js loops Flashcards
What is the purpose of a loop?
code that will run multiple times
What is the purpose of a condition expression in a loop?
when the condition evaluates to false, the loop stops
What does “iteration” mean in the context of loops?
every time the loop runs is one “iteration”
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, at start of first iteration
When does the condition expression of a for loop get evaluated?
before each iteration
When does the final expression of a for loop get evaluated?
end of 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?
increases value by 1
How do you iterate through the keys of an object?
Object.keys(objectName)