DEV Community

vishwa v
vishwa v

Posted on

For loop

For Loops can execute a block of code a number of times.

<script>
        for(i=1;i<=5;i++){
            console.log(i)
        }
    </script>
Enter fullscreen mode Exit fullscreen mode

do
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

Top comments (0)