Do While Loop with Infinite Loops

Do While Loop with Infinite Loops

In this post, we are going to checkout Do while loop with infinite loops in typescript and its examples. Do while Loop in Typescript is same as the Do While Loop in Javascript

Do While Loop with Infinite Loops

This is an example of do while infinite with conditional expression always set to true.

let counter = 1;   

do {  
    console.log(counter)  
    counter++;    
}  

while (true) 


The above example for Do while Loop prints the result as follows:

Output is 1  
2   
Infinite 


Happy Coding!

πŸ”₯ 5 Views
Sep 2, 2022