JavaScript Process Control Statements
Learning Essentials:
1. Definition of statements
2.if statements
3.switch statements
4.do...while statements
5.while statements
6.for statements
7.for...in statements
8.break and Continue statements
9.with statements
ECMA-262 sets up a set of process control statements. A statement defines the primary syntax in ECMAScript, which typically consists of one or more keywords to accomplish a given task. such as: Judgment, circulation, exit, etc.
A. definition of a statement
In ECMAScript, all the code is composed of statements. Statements indicate the process, qualification, and convention in the execution, which can be either a single line statement or a compound statement enclosed by a pair of curly braces "{}", in which the composite statement can be treated as a single-line statement in the syntax description.
Types of statements
Type |
Sub-type |
Grammar |
Statement statement |
Variable declaration statements |
var box = 100; |
Label declaration statement |
|
An expression statement |
Variable assignment statements |
box = 100; |
Function Call statement |
Box (); |
Property Assignment Statements |
Box.property = 100; |
Method Invocation Statement |
Box.method (); |
Branch statements |
Conditional branching statements |
if () {} else {} |
Multiple branching statements |
Switch () {Case n: ...}; |
1
Section 101th, JavaScript Process Control statements