For all control structures except the switch statement, transfer of program control is based upon a decision, the result of which is a truth statement (returning a Boolean true or false). You create an expression and then test whether its result is true. There are two main kinds of program control structures.
Selection Control Structure
The selection structure specifies alternate courses of program flow, creating a junction in your program (like a fork in a road). Four selection structures are available in JScript.
- the single-selection structure (if)
- the double-selection structure (if...else)
- the multiple-selection structure (switch)
- the inline conditional operator ?:
No comments:
Post a Comment