I l@ve RuBoard Previous Section Next Section

30.4 switch Statement

  • Always put a default case in a switch statement. Even if it does nothing, put it in:

    switch (expression) { 
        default: 
            /* Do nothing */;
            break;
    } 
  • Every case in a switch should end with a break or a /* fall through */ statement.

    I l@ve RuBoard Previous Section Next Section