Remove timeOut / alt. Remove timer from setAndStartTimer

So I have been trying hard enough with this, I just have to ask:

How to remove a timeOut (or alternate version from setAndStartTimer).
For whatever I do, it still triggers or in case of the new setAndStartTimer it says it’s removed but the next time I create it, it adds to the former one.

Basically, I thought I was doing something simple.
I have a function that depending on conditions starts a timer. On timer end, another function is called that starts an animation.
But, if aborted (because I.E. I’m requesting a new timeOut for another animation), I need this former timeOut to be removed and not to trigger, while the new one will kick-in.

For some reason, I’m just unable to remove/clear this timeout (classic or new). :cry:
Thanks in advance for your help with this. Meanwhile, have a great day :sunglasses:

Or am I missing something else?

What is the expected console output?

As @Aus_Karlos said here is a version with clearTimeout:

1 Like

Thanks, no you’re not missing something… I was :face_with_hand_over_mouth: I think I was missing my brain :brain: :grin: For some reason, I was looking towards a babylon method, didn’t even think it’s actually just js. Even funnier is that I’m using clearInterval to clear my intervals (LOL). Point is the overal assembly I have is quite complex. At some point, just wasn’t able to think straight anymore :dizzy_face:
Thanks a lot for your help. I should be able to finish this part now that this is solved. Have a great day :sunglasses: