HardPro challengeJavaScriptTypeScript

Throttle Renders

ReactPerformanceThrottle

Throttle update events: at most one update per interval. Given a list
of [time, value], return only the values that pass through.

Sample tests

Test #1Empty events
Input: [[],100]
Output: []
Test #2b suppressed
Input: [[[0,"a"],[50,"b"],[100,"c"]],100]
Output: ["a","c"]
Test #3Single event
Input: [[[0,"a"]],100]
Output: ["a"]
Test #4All pass
Input: [[[0,"a"],[200,"b"],[400,"c"]],100]
Output: ["a","b","c"]
Test #5b and d suppressed
Input: [[[0,"a"],[50,"b"],[200,"c"],[220,"d"]],100]
Output: ["a","c"]