SOURCE

for (var i = 1; i <= 5; i++) {
  (function (i) {
    setTimeout(function timer() {
      console.log(i);
    },i * 1000)
  })(i)
}
console 命令行工具 X clear

                    
>
console