I am interested in the \"debouncing\" function in javascript, written here : http://davidwalsh.name/javascript-debounce-function
Unfortunately the code is not explai
Debounced functions do not execute when invoked, they wait for a pause of invocations over a configurable duration before executing; each new invocation restarts the timer.
Throttled functions execute and then wait a configurable duration before being eligible to fire again.
Debounce is great for keypress events; when the user starts typing and then pauses you submit all the key presses as a single event, thus cutting down on the handling invocations.
Throttle is great for realtime endpoints that you only want to allow the user to invoke once per a set period of time.
Check out Underscore.js for their implementations too.