I’m wondering if it is possible in Javascript to call a function up to a number of N times to get a truthy value back. It should immediately return if the return is true. It should at least return regardless of the return value after N times.
I read a bit through existing resources and came to the point that it is not possible, but normally done with a callback function. Are there any patterns / best practices / examples for that?
I came up with the following implementation:
For example to try 30 times each 250 milliseconds if the tag-editing has been enabled, you can run the following: