As an example
var runInfinite = function(){ while(1) { // Do stuff; } }; setTimeout(runInfinite, 0);
Is it possible to
The answer is no. Since JavaScript is single-threaded ( unless you are using some less common implementation which I doubt ) nothing can break a loop ( or any other block of code ) from outside.