A function that is called every ms milliseconds.
If it returns true, the interval is cleared.
The interval time in milliseconds between callback executions.
Optionaltimeout: numberOptional timeout in milliseconds. If provided, the interval will be automatically cleared after this duration, regardless of callback return value.
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
trueor until timeout is reached. Once the callback returnstrueor the timeout expires, the interval is cleared and the polling stops.