I have an IF / ELSE statement, although I would like to know how to tell the "else" part to do nothing if it is true. e.g.:
if(x == x)
//run calc.exe
else
//DoNothing
Or I am write in saying that if I just remove the else statement, it will continue anyway if the if condition is not matched?
The continue statement skips the current iteration of the loop and continues with the next iteration. Its syntax is: continue; The continue statement is almost always used with the if...else statement.
An IF statement is executed based on the occurrence of a certain condition. IF statements must begin with the keyword IF and terminate with the keyword END.
The ending else is not mandatory as far as JavaScript is concerned. As for whether it is needed, it depends on what you want to achieve. The trailing else clause will execute when none of the specified conditions is true.
A block If statement must be the first statement on a line. The Else, ElseIf, and End If parts of the statement can have only a line number or line label in front of them. The block must end with an End If statement.
just omit the else
if(condition)
{
do_something();
}
//go on with your program
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With