Event Loop & Timers
Throttle with Leading and Trailing Flags
hardJS SpecificJS / TS3 tests
Problem Statement
Implement `throttleWithOptions(fn, wait, { leading = true, trailing = true })` that invokes `fn` at most once per `wait` milliseconds, with configurable leading and trailing edge execution.
Examples
Example 1:
const throttled = throttleWithOptions(onScroll, 200, { leading: true, trailing: false });JavaScript & TypeScript starter code included
Run this as a live interviewPractice solo
3 test cases. No second person needed.