Meta interview question

Implement debounce and throttle in JavaScript