For instance, I am setting an interval like
timer = setInterval(fncName, 1000);
and if i go and do
clearInterval(timer);
it does clear the interval but is there a way to check that it cleared the interval? I’ve tried getting the value of it while it has an interval and when it doesn’t but they both just seem to be numbers.
There is no direct way to do what you are looking for. Instead, you could set
timerto false every time you callclearInterval:Now,
timerwill either be false or have a value at a given time, so you can simply check withIf you want to encapsulate this in a class: