问题 I've looked at many different solutions to this, none of which worked. I know it has something to do with setTimeout, but I don't know how to implement it properly. function myfunction() { //the function //wait for 1 second before it can be ran again } To clarify: I don't want to call the function at a regular interval, I want to be able to enforce a delay before the function can be called again. 回答1: I think the easiest solution would be to hold a boolean variable and reset it to true after