the if statement |
IF ... ELSE IF ... ELSE |
This kind of statement controls the flow of the code execution based on the results of given comparison. |
the switch statement |
SWITCH ... CASE ... DEFAULT |
This type of a conditional statement is always used for more than a few solutions needed in a regular code flow and therefore it is applied to more complex situations than the if statement. |
the while statement |
WHILE |
The while statement is a loop executing kind of a statement used to pre-test flow code conditions. |
the do-while statement |
DO ... WHILE |
The do...while statement is a loop executing kind of a statement used to post-test flow conditions. Due being a post-test statement, the loop gets executed at least one time. |
the for statement |
FOR |
This type of a statement is the most popular loop execution statement. The reason for that is due to we can initialize variables, set the expression, and start the iteration in a single line of code. |
the for-in statement |
FOR (property IN object) |
The for...in statement is used to return a property or properties of an object. |
the break statement |
BREAK |
This statement works great with if statements and for loops. A break statement exits the loop immediately and the execution continues with the first line after the loop. |
the continue statement |
CONTINUE |
This statement works great with if statements and for loops. A continue statement stops the loop immediately but it doesn't exit it, it actually continues from the top of the same loop; therefore it just skips the current loop count. |
labels |
LABEL: |
The labels or label statements are often used with the loops in sense that they "tell" the loop where in code to jump to after a condition has been met. |
the with statement |
WITH |
The with statement sets the scope of the code within a particular object. |
Comments
No comments have been made yet.
Please login to leave a comment. Login now