I have this function that is triggered if a user clicks a div. The user can click this div many times, thus triggering the function many times.
Every time the function is called while it is already running, I want the currently running function to stop running and start over. This is hard to describe but I hope it makes sense. Essentially, I want the function to run completely through only if the user does not trigger the function again while it is running.
Is there a way to do this?