← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Implement a throttle function that takes a callback function and a delay in milliseconds, and returns a new "throttled" version of that callback. The throttled function may be invoked repeatedly, but the original callback must be executed at most once per delay period. Specifically:
this context and all supplied arguments..cancel() method on the returned throttled function that cancels any pending scheduled execution and resets internal state so the next call will again be treated as the "first" call.This is the classic "leading-edge" throttle with no trailing call.