Managing exceptions when using setInterval throwing or hitting an exception or assert will not stop the interval update let c 0 function update console log c c c if c 3 throw what var iid setInterval try update catch e console log exception e clearInterval iid 1000
if c 3 throw what var iid setInterval try update catch e console log exception e clearInterval iid 1000