Debounce Functions
Problem
You want to execute a function only once, coalescing multiple sequential calls into a single execution at the beginning or end.
Solution
With a named function:
Discussion
Learn about debouncing JavaScript methods at John Hann’s excellent blog article.