let 块级作用域在循环中执行异步操作的使用(Use of let block level scope to perform asynchronous operations in a loop)

对于没有块级作用域的变量,在循环中执行异步操作,会在循环完成后都使用循环最后的同一值

如:

————————

For variables without block level scope, when performing asynchronous operations in the loop, the same value at the end of the loop will be used after the loop is completed

For example: