else

else executes when the condition is false.

Syntax

if (condition) {
  code
} else {
  code
}

Example | True

Example | False

External

Mozilla Developer Network