0% found this document useful (0 votes)
43 views3 pages

Loops

Javascript has several types of loops that allow code to be repeatedly executed, including for, while, and do...while loops. For loops are generally used when the number of iterations is known and for iterating through arrays. They have a begin, condition, and step section to control loop execution. While and do...while loops check a condition either before or after executing the loop body.

Uploaded by

Vinod Srivastava
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views3 pages

Loops

Javascript has several types of loops that allow code to be repeatedly executed, including for, while, and do...while loops. For loops are generally used when the number of iterations is known and for iterating through arrays. They have a begin, condition, and step section to control loop execution. While and do...while loops check a condition either before or after executing the loop body.

Uploaded by

Vinod Srivastava
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Javascript loops

Loops are programming constructs that facilitate the execution


of a set of instructions of code repeatedly, as long as a certain
condition is met.  

Loops

Entry Level Exit Level


Entry controlled loop is a loop in which the test Exit controlled loop is a loop in which the loop
condition is checked first, and then loop body will body is executed first and then the given
be executed. condition is checked afterwards.
In entry controlled loop, if the test condition is In exit controlled loop, if the test condition is false,
false, loop body will not be executed. loop body will be executed at least once.

for while do..while


for Loops

 for loops generally used where we know no of times loops will iterate the
loop body
 for loops is also preferred when we have to iterate through array element in
JavaScript

Syntax

for (begin; condition; step)


{ // ... loop body ... }

You might also like