Function clearTimeout

  • Cancels a scheduled action initiated by setTimeout()

    note: only js2.0 support

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

    Parameters

    • Optional id: number

    Returns void