Practice / Software

Write debounce

Easy · Coding (typed)

Write debounce(fn, wait): it returns a function that only calls fn once the calls have stopped for wait milliseconds, with the latest arguments. Then explain when you would use debounce instead of throttle.

Create a free account to answer it and get scored on what a strong answer covers.