if/else | NN 2 IE 3 ECMA 1 |
This is a conditional statement that provides two execution paths depending on the result of the condition. You can nest another if or if/else statement inside either path of the if/else statement. |
|
Example | |
var theMonth = myDateObj.getMonth( ); if (theMonth == 1) { monLength = calcLeapMonthLength( ); } else { monLength = calcMonthLength(theMonth); } |