setTimeout中第二个参数是选填还是必填?
这种东西还是以规范为准吧 https://www.w3.org/TR/2011/WD-html5-20110525/timers.html规范里的接口定义是这样的[Supplemental, NoInterfaceObject]
interface WindowTimers {
long setTimeout(in any handler, in optional any timeout, in any... args);
void clearTimeout(in long handle);
long setInterval(in any handler, in optional any timeout, in any... args);
void clearInterval(in long handle);
};
Window implements WindowTimers;看第一行,timeout是可选的
赞0
踩0