for(var i = 1; i < 6; i++) { setTimeout(function() { console.log(i); },1000); } console.log('The loop is done!');