In JavaScript there are 4 types of Looping Statements:
Syntax:
for(Initialization; Test Condition; Increment/Decrement)
{
-----------------;
------------------;
}
2. While Loop:
Syntax:
Initialization;
while(Test Condition)
{
----------------;
----------------;
Increment/Decrement statement;
}
3. Do While Loop:
Syntax:
Initialization;
do
{
----------------;
----------------;
Increment/Decrement statement;
}while(Test Condition);
4. For In Loop:
For displaying Array elements)
Syntax:
for(var_name in Array_name)
{
--------------------;
---------------;
}
- For Loop
- While Loop
- Do While
- For In (For displaying Array elements)
Syntax:
for(Initialization; Test Condition; Increment/Decrement)
{
-----------------;
------------------;
}
2. While Loop:
Syntax:
Initialization;
while(Test Condition)
{
----------------;
----------------;
Increment/Decrement statement;
}
3. Do While Loop:
Syntax:
Initialization;
do
{
----------------;
----------------;
Increment/Decrement statement;
}while(Test Condition);
4. For In Loop:
For displaying Array elements)
Syntax:
for(var_name in Array_name)
{
--------------------;
---------------;
}
No comments:
Post a Comment