--- title: "Loops Component" slug: "loops-component" updated: 2023-02-13T09:54:50Z published: 2023-02-13T09:54:50Z canonical: "help.pillir.io/loops-component" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.pillir.io/llms.txt > Use this file to discover all available pages before exploring further. # Loops Component The Loops component is primarily used to perform operations repeatedly in the form of iterations. ## While Block The **While** statement loops through a block of code as long as a specified condition is true. The do while loop is a variant of the while loop. This loop will execute the code block once, before checking if the condition is true, then it will repeat the loop as long as the condition is true. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Choose the repeater type (while or until), Boolean (True or False), The repeater statement. | For **while** repeater, it will execute the statement until it becomes false. For **until** repeater, it will execute the statement until it becomes true. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620900150082.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620900175006.png) | ```javascript while (false) { } while (!false) { } ``` | ## For Block The **For loop** loops through a block of code a number of times. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Variable or number for: (from)input-1,(to)input-2, and (by)input-3 Any code block within **"****do**" statement | For the **count repeater**, it will execute the given statement block based on "from-to" input values and the step(by) value. We can have high to low or low to high. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620900210080.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620900241774.png) | ```javascript var i; function er_3eff8d47_6dd5_4f07_92d0_fd3d291010bd_onPageShow(e,obj,index){ for (i = 1; i <= 10; i++) { } } ``` | | Table variable(array) in **list,** Any code block within **"****do**" statement | In **f****or each** repeater, it will execute till the given list length. It will also give each list value to a variable. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620900274545.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620900296665.png) | ```javascript var j; function er_3eff8d47_6dd5_4f07_92d0_fd3d291010bd_onPageShow(e,obj,index){ var j_list = []; for (var j_index in j_list) { j = j_list[j_index]; } } ``` | ## Repeater Block The **Repeater** block is used to execute the "do" statement block for a selective number of times. They can be used within the For and While loops. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Variable or Number The repeater statement. | The repeater will execute the given statement for a fixed number of times. | ![Repeater](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/Repeater.png) | ```javascript async function er_1673435223_click(e,obj,index){ for (var count = 0; count < 10; count++) { } } ``` | ## Break or Continue Block The **Break** statement is used to jump out of a loop. It can be used within any of the loops. (Mostly Break and Continue statements are used within While Loops) The **Continue** statement breaks one iteration (in the loop), if a specified condition occurs, and continues with the next iteration in the loop. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | NA | It will break out of the repeater or continue to the next iteration. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620900411376.png)![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620900433384.png) | ```javascript for (i = 10; i >= 1; i--) { break; } for (i = 10; i >= 1; i--) { continue; } ``` |