function clearTimeout
clearTimeout(id?: number): void

Cancels a scheduled action initiated by setTimeout()

const id = setTimeout(() => {console.log('hello');}, 500);
// ...
clearTimeout(id);

Parameters

optional
id: number

Return Type

void