< JavaScript < Reserved words
![](../../../I/m/Crystal_Clear_action_apply.png)
The code
The if keyword
The if keyword stars a loop that executes until the condition is met.
Examples
![](../../../I/m/Crystal_Clear_action_apply.png)
var result = 1;
if (result%2 == 0) {
console.log(result + " is an odd number");
} else {
console.log("result + " is an even number");
}
returns the following:
1 is an even number
See also
This article is issued from
Wikibooks.
The text is licensed under Creative
Commons - Attribution - Sharealike.
Additional terms may apply for the media files.