for (var i = 0; i < 8; i++) { var a = 100 } console.log(a) //100
for (var i = 0; i < 8; i++) { let a = 100 } console.log(a) //报错