Interrupt function

“Interrupting” a function is not possible (if i understand what you mean by that)
However, if you wish to stop the timeout you can save a reference to the id it generates

let timer_id = setTimeout(…)

and with this you can interrupt the timeout
clearTimeout(timer_id)