摘要:
var num = 0;var max = 10;function incrementNumber() {num++;//if the max has not been reached, set another timeoutif (num < max) {setTimeout(incrementNumber, 500);} else {alert(“Done”);}}setTimeout(incrementNumber, 500);如果用setInterval 可能出现 下次调用会在前一次调用前调用 (True intervals are rarely used in producti 阅读全文