JavaScript Loops.

Passionate about crafting elegant code and building innovative solutions that make a positive impact. 🚀 Join me on a journey through the realms of technology as I share my experiences, insights, and latest discoveries. 💡 Let's dive into the world of software engineering, development trends, and emerging technologies together. Follow along for a dose of tech inspiration and knowledge.
At times, certain instructions require repeated execution. Loops are an ideal way to do the same. A loop represents a set of instructions that must be repeated. In a loop's context, a repetition is termed as an iteration.
The following figure illustrates the classification of loops-
![Screenshot_20210531-001205[1].png](https://cdn.hashnode.com/res/hashnode/image/upload/v1622416431007/OXoLEMkzO.png)
Definite Loop
A loop whose number of iterations are definite/fixed is termed as definite loop. The 'for loop' is an implementation of a definite loop.
for (initial_count_value;
termination-condition; step) {
//statements
}
![Screenshot_20210531-001626[1].png](https://cdn.hashnode.com/res/hashnode/image/upload/v1622416711416/J3iFs67YN.png)
Indefinite Loop
An indefinite loop is used when the number of iterations in a loop is indeterminate or unknown.
Indefinite loops can be implemented using:
![Screenshot_20210531-001643[1].png](https://cdn.hashnode.com/res/hashnode/image/upload/v1622416838164/F9O5Mi9_4.png)
The Loop Control Statements
![Screenshot_20210531-001659[1].png](https://cdn.hashnode.com/res/hashnode/image/upload/v1622416882263/GmC5IcMSR.png)
Using Labels to control the flow
A Label is simply an identifier followed by a colon(:) that is applied to a statement or a block of code. a label can be used with break and continue to control the flow more precisely.
Line breaks are not allowed between the 'continue' or 'break' statement and its label name. Also, there should not be any statement in between a label name and an associated loop.
![Screenshot_20210531-001738[1].png](https://cdn.hashnode.com/res/hashnode/image/upload/v1622417116079/CtQHCfEGp.png)



