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
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

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

All rights reserved.