while(true){ window.setTimeout(function() { myMethod() }, 15000); } function myMethod() { alert(\"repeat\
setTimeout is executed asynchronously. So in your code, the infinite loop is creating an infinite setTimeouts each with a delay of 15 secs.