As shown in the picture above, it shows that i has been declared, that is, it cannot be declared repeatedly; while in the picture below But it can be re-declared using let, why?
曾经蜡笔没有小新2017-05-19 10:16:43
Why can let be repeated? Icon
Why do let statements conflict with var statements? First, the var statement will be promoted to the top of the current function, that is, the order is as follows:
var i
This is the beginning of the for loop
Just started parsing let i = 0 --->Error report
Look at the picture again
滿天的星座2017-05-19 10:16:43
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|