1. Home
  2. Computing & Technology
  3. JavaScript

Else

By Stephen Chapman, About.com

Definition: The else clause within an if statement specifies code that is to be run when the condition attached to the if statement evaluates to false or zero. Else is a reserved word and cannot be used for anything other than declaring an else clause within an if statement.
Examples: if (a == b) {...} else {...}

Explore JavaScript

More from About.com

  1. Home
  2. Computing & Technology
  3. JavaScript
  4. Reference
  5. Javascript Glossary - Else

©2008 About.com, a part of The New York Times Company.

All rights reserved.