var second = 60;
var timer;
// 倒计时
function countDown(){
second–;
console.log(second)
if(second == 0){
second = 60
clearTimeout(timer)
return
}
timer = setTimeout(‘countDown()’, 1000);
}
countDown()
var second = 60;
var timer;
// 倒计时
function countDown(){
second–;
console.log(second)
if(second == 0){
second = 60
clearTimeout(timer)
return
}
timer = setTimeout(‘countDown()’, 1000);
}
countDown()