JavaScript Utilities

Implement Throttle

mediumJS SpecificJS / TS4 tests

Problem Statement

Implement a `throttle` function that creates a throttled function that only invokes `fn` at most once per every `limit` milliseconds.

Examples

Example:
const log = throttle(() => console.log('Throttled'), 1000);
log(); // Runs immediately
log(); // Ignored if called within 1000ms
JavaScript & TypeScript starter code included
Run this as a live interview

Practice solo

4 test cases. No second person needed.

Get new interview exercises

Practice problems and review drills, sent when we publish new ones. No spam.

Unsubscribe anytime. We never share your address.