跳至主要內容

setTimeout 和 setInterval

小于 1 分钟featureweb-standardmissing-example

setTimeoutsetInterval

为修复 IE9- 的额外参数:

// 以前:
setTimeout(log.bind(null, 42), 1000);
// 现在:
setTimeout(log, 1000, 42);

模块

类型

function setTimeout<A extends Array<any>>(
  callback: (...args: A) => void,
  time: number,
  ...args: A
): number;
function setInterval<A extends Array<any>>(
  callback: (...args: A) => void,
  time: number,
  ...args: A
): number;

入口点

core-js(-pure)/stable|actual|full/set-timeout
core-js(-pure)/stable|actual|full/set-interval