I want to make a timer using while, and when I lunch the code in Chrome, the Chrome don't load.
I am making this:
var time = 0;
        while (time < 5) {
            setTimeout(function(){
                tempo[0].innerHTML = time;
                time++;
            }, 1000);
        }
I expect when time it gets to 5, javascript will exit the loop and execute the next action
 
    