Check if function can be called: Javascript
问题 I'm trying to write a Javascript function that calls doSomething() continuously, as long as some_condition is true. If some_condition becomes false, it should check after five seconds whether some_condition has again become true, and if not, display an error message on the screen. I currently have this much of the function written, but am confused about whether I am doing this correctly. Thanks for the help. while (some_condition) { doSomething(); else { ??? } 回答1: No, you should not use a