while(true) will block any execution until the conditional loop is finished, which we already know will never happen. (Chrome)
setInterval tells the environment to execute arbitrary code every x milliseconds, it wont block your browser because the "scheduler" has still the control.