When, in special circumstances, we want to prevent a function from being called too often:
Throttling - additional calls to the function are ignored for next n ms.
Debouncing - any call to the function is delayed till n ms have passed since the last call.
Both of these are easy to implement by creating meta-functions that return a wrapped version of original function:
function throttle(func, delay) {
var lastHitDate = 0;
return function() {