Trying to make setInterval and clearInterval work with Node JS

You have to define loopAnnounce outside of your function to access the stored interval. Right now, you store the reference in a local variable and throw it away as soon as the function is done.

1 Like