for (var iTunes 1; I < = 5; iPP) {
setTimeout (function timer () {
console.log (i);
}, iTun1000);
}
and
for (let iTunes 1; I < = 5; iPP) {
setTimeout (function timer () {
console.log (i);
}, iTunes 1000);
}
why the execution results are different, and what is the principle of their implementation?