for (var i=1; i<=5; i++) {
(function(j) {
console.log( j);
console.log( new Date());
setTimeout( function timer() {
console.log( j );
console.log( new Date() );
}, j*1000 );
})( i );
}
为什么间隔时间每次都是1s
慕勒3428872
UYOU
随时随地看视频慕课网APP
相关分类