+ 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.
4 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
+ 3
while (true){
console.log('hello world')
}
There are many ways to do but this is simple one.
+ 2
for(;;) alert("hello")
0
Hello