Statement:
Most JavaScript programs contain JavaScript statements .The statements are executed, one by one in the same order as they are written. Example:
JavaScript Variable:
Variable(Binding) means anything that can vary. JavaScript includes variables which hold the data value and it can be changed anytime. Example:
Conditional Execution:
In JavaScript conditional execution is created with the if keyword. In simple case, we want some code to be executed if, and only if ,a certain condition holds.
JavaScript includes three forms of if condition:
- if condition,
- if else condition and
- else if condition.
If condition:
Syntax:
Example:
if else condition:
Syntax:
Example:
else if condition:
Syntax:
Example:
While Loop:
Syntax:
Example:
Do while loop:
Syntax:
Example:
For Loop:
Syntax:
Example:
Switch:
Syntax:
Example: