As an example
var runInfinite = function(){ while(1) { // Do stuff; } }; setTimeout(runInfinite, 0);
Is it possible to
The whay you want not really. But maybe you're doing it wrong. Try not to use while(1) if possible and at the end of the function call the function again if the outside flag triggered but some break button is not set, or return if otherwise
while(1)