Skip to content

if else statements

Frederik Tobner edited this page Nov 8, 2022 · 2 revisions

The if keyword is used to specify a block of code that will be executed, if a specified condition is true.

if(condition) {
/* Code that will be executed if condition is true */ ;
}

The else keyword is used to specify a block of code that will be executed, if the same condition is false.

if(condition) {
/* Code that will be executed if condition is true */ ;
}
else {
/* Code that will be executed if condition is false*/ ;
}
Clone this wiki locally