setTimeout

Sets a timer which executes a function once after the timer expires. Returns an id which may be used to cancel the timeout.

setTimeout(() => { console.log('hello'); }, 500);
function setTimeout(
cb: (...args: any[]) => void,
delay?: number,
...args: any[],
): number;
§
setTimeout(cb: (...args: any[]) => void, delay?: number, ...args: any[]): number
[src]

§Parameters

§
cb: (...args: any[]) => void
[src]
§
delay?: number optional
[src]
§
...args: any[] optional
[src]

§Return Type

§
number
[src]