#2
claver2022-08-15 17:45
|
代码一:
程序代码:
for (let i=0;i<=1;i++)
{
setTimeout(()=>{console.log(i)},1000)
}
//output: 0 1
代码二:
程序代码:
{
let i=0
{
setTimeout(()=>{console.log(i)},1000)
}
i++
{
setTimeout(()=>{console.log(i)},1000)
}
}
//output: 1 1