How to print hello world for infinite times in javascript? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to print hello world for infinite times in javascript?

How to print hello world for infinite times in javascript? I tried this . But, it not done.

5th May 2020, 2:17 AM
🐕Pradeep Simba 🐶
🐕Pradeep Simba 🐶 - avatar
3 Answers
+ 4
The answer of while(true), or for(;;) forever loop are impractical, it only makes the webpage hang with white page. Use setInterval to run the loop. setInterval(()=>document.body.innerText += 'Hello World! ',100) https://code.sololearn.com/W4zC0qUgW6Gy/?ref=app
5th May 2020, 3:32 AM
Calviղ
Calviղ - avatar
+ 3
while (true){ console.log('hello world') } There are many ways to do but this is simple one.
5th May 2020, 2:27 AM
Sudarshan Rai
Sudarshan Rai - avatar
+ 2
for(;;) alert("hello")
5th May 2020, 2:29 AM
Dasarath Singh