JavaScript/Reserved words/if

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Previous: goto Reserved words Next: implements

The if keyword[edit]

The if keyword stars a loop that executes until the condition is met.

Examples[edit]

Crystal Clear action apply.png The code
  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[edit]

Previous: goto Reserved words Next: implements