advanced
Challenge: debounce with cancel and flush
Implement this from the stub. Hidden tests grade the behaviour you write, not the comments you leave.
Challenge: Debounce with Cancel and Flush
export interface Debounced {
(value: string): void
cancel(): void
flush(): void
}
export function debounce(fn: (value: string) => void, waitMs: number): Debounced {
// Your implementation here
}challenge — implement from scratchCtrl+↵ submits · Ctrl+Shift+↵ runsstarter code