javsacript-if Flashcards
Give 6 examples of comparison operators.
<
>
>=
<=
===
strictlynotequal
What data type do comparison expressions evaluate to?
boolean true or false
What is the purpose of an if statement?
to create pathways for decision making
Is else required in order to use an if statement?
else is not required for if but if is required for else
How do you compare two different expressions in the same condition?
use logical operators. logical and(&&) or logical or (||)
What is the purpose of a loop?
to easily perform a repetitive action
What is the purpose of a condition expression in a loop?
to tell the loop when to stop
What does “iteration” mean in the context of loops?
one full cycle
When does the condition expression of a while loop get evaluated?
right before the loop is about to be entered
When does the initialization expression of a for loop get evaluated?
it’s the first piece of the if statement to be evaluated and only gets evaluated once
When does the condition expression of a for loop get evaluated?
before the code block is entered but after the final expression
When does the final expression of a for loop get evaluated?
after the code block but before the condition expression
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 1 to the variable on its left
How do you iterate through the keys of an object?
by using a for in loop