js while
snippet in javascript

js while

user7533

let i = 0;
while (i < 3) {
	console.log(i)
    i++;
} 
/*
Console:
0
1
2
*/

javascript while

user6191

var i=0;
while (i < 10) {
	console.log(i);
	i++;
}
//Alternatively, You could  break out of a loop like so:
var i=0;
while(true){
	i++;
	if(i===3){
		break;
	}
}

javascript while loop

user3251

while (i < 10) {
  text += "The number is " + i;
  i++;
}

javascript while loop

user1610

while(condition) {
  //whatever
}

while javascript

user916



while (condition) {

      // code block to be executed

 }