If an output is true, then run a statement. Otherwise it does nothing.
Else if:
If the first output is true, then run a statement. Otherwise if the second output is true, then run the second statement. Otherwise it does nothing.
Else:
If other outputs were false, then run the "else" statement.
What the decode looks like:
// Make sure the last thing is the "else" statement and the first one being the "if" statement. if (var firstOutput) { . . . } else if (var secondOutput) { . . . } else { . . . }
Aaron The Teacher
JavaScript teaching #1 (the if command)
If:
If an output is true, then run a statement. Otherwise it does nothing.
Else if:
If the first output is true, then run a statement. Otherwise if the second output is true, then run the second statement. Otherwise it does nothing.
Else:
If other outputs were false, then run the "else" statement.
What the decode looks like:
// Make sure the last thing is the "else" statement and the first one being the "if" statement.
if (var firstOutput) {
. . .
} else if (var secondOutput) {
. . .
} else {
. . .
}
1 month ago | [YT] | 0
View 1 reply