Conditional code Flashcards
What is the basic building block of the “IF” statement in javascript
if ( . . . ) { . . .
}
( . . . ) represents ____________
If (The condition is true) {
Then do what is between this
}
( . . . ) = If this condition is true
{ . . . } represents _____________
If (The condition is true) {
Then do what is between this
}
{ . . . } = then do what is between these curly braces
( 1 )
Parentheses
[ 1 ]
brackets, oftentimes called square brackets
{ 1 }
curly braces
what is the purpose if braces, parenthesis, and brackets in coding?
They mark where a type of statement begins and ends
are braces, parenthesis, and brackets sometimes interchangeable?
NO, never change them nigga
brackets, braces, and parenthesis are always found in….
PAIRS
ALL conditions must boil down to….
true or false
how do you check for quality in a javascript condition?
==
double equal sign
If ( a==99) { execute this command
}
why is == a quality check and not one equal sign?
*Why use:
If ( a==99) { execute this command
}
and NOT
If ( a=99) { execute this command
}
because 1 equal sign SETS a value. a==99 means CHECK if a==99, and a=99 means a IS 99
If ( a==99) { execute this command
}
If ( a=99) { execute this command
}
how do you check inequality? that is check if a is NOT some variable
If ( a!=99) { execute this command
}
code block
several statements all grouped together, normally with the use of braces, parenthesis, or brackets.
how many lines if “IF” statements can javascript understand?
theoretically, infinite…