Loading problem…
This problem builds on throttle-function. Complete that first, then load your solution to continue.
Implement an enhanced throttle function that extends the basic throttle functionality with advanced features like cancellation, flushing, and return value handling.
fn and a delay delay in millisecondscancel() and flush()fn at most once per delay millisecondscancel() methodcancel() should cancel any pending executionflush() methodflush() should immediately execute any pending callfn when executedundefined if none)this context of the original function call