Repeatedly invokes a callback function at a given interval until it returns true. Once the callback returns true, the interval is cleared and the polling stops.
true
A function that is called every ms milliseconds. If it returns true, the interval is cleared.
ms
The interval time in milliseconds between callback executions.
The interval timer ID, which can be used to clear the interval manually if needed.
Repeatedly invokes a callback function at a given interval until it returns
true. Once the callback returnstrue, the interval is cleared and the polling stops.