I have a question, can you write a while(true)
in HTML5 with javascript? I await your answers and thank you in advance for your help, regards.
I have a question, can you write a while(true)
in HTML5 with javascript? I await your answers and thank you in advance for your help, regards.
Yes, of course you can. In while
you can put any valid javascript expression, also a constant as true
:
var cont=0;
while(true){
console.log(cont++);
if (cont>10) { break; }
}
While (condicion) {
Codigo que se va a ejecutar
}
The code will be executed, when the condition is fulfilled.