it's working correctly, basically, the loop serves as shorthand for writing this:
setTimeout( function(){ console.log(0) }, 1000)
setTimeout( function(){ console.log(1) }, 2000)
setTimeout( function(){ console.log(2) }, 3000)
setTimeout( function(){ console.log(3) }, 4000)
setTimeout( function(){ console.log(4) }, 5000)
so it would make sense that each goes off one after the other kinda looking like this:
▀
▀▀
▀▀▀
▀▀▀▀
▀▀▀▀▀
what you might be looking for is
(function newTimeout( seconds ){
if( seconds > 4 ) return;
console.log(seconds);
setTimeout( function(){
newTimeout( seconds + 1 )
}, seconds * 1000);
})(0);
which would kinda look like this
▀
▀▀
▀▀▀
▀▀▀▀
▀▀▀▀▀
hope it helps!