Infinite Javascript loop for a web page [closed]

-9

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.

    
asked by WTFChamp 31.08.2017 в 11:40
source

2 answers

4

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; }
}
    
answered by 31.08.2017 / 11:47
source
0
While (condicion) {
 Codigo que se va a ejecutar
}

The code will be executed, when the condition is fulfilled.

link

    
answered by 31.08.2017 в 11:46