js定時器避免閉包的情況,用實參傳給形參
例:
function test(){
var i ;
for(i=0;i<10;i++){
setTimeout(function (index){
return function(){console.log(index);}
}(i),i*1000)
}
}
js定時器避免閉包的情況,用實參傳給形參
例:
function test(){
var i ;
for(i=0;i<10;i++){
setTimeout(function (index){
return function(){console.log(index);}
}(i),i*1000)
}
}
t前後都輔音時候不發音. fasten hasten apostle castle whistle listen often 結尾時候不發音 ballet