While Loop in JavaScript

How to use while loop in JavaScript?

Last updated:7/19/2021 5:32:59 AM

1 Answers

Ethan Karla
Ethan Karla

We use of loops in a program for execute the block of code to particular time.

While loop is one of the type of the loop in which we perform any operation to nth number of time.

For loops are great for doing the same task over and over when you know ahead of time how many times you'll have to repeat the loop.

On the other hand, while loops are ideal when you have to loop, but you don't know ahead of time how many times you'll need to loop.

Answer