nodejs while loop code example
Example 1: javascript while
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;
}
}
Example 2: javascript while loop
while (i < 10) {
text += "The number is " + i;
i++;
}
Example 3: javascript while loop
while(condition) {
//whatever
}
Example 4: define a while loop in node js
while (n < 3) {
n++;
}