code: function debounce(fn, delay) {
          return function () {
            var self = this, args = arguments;
            clearTimeout(timer);
            console.log('debounce()');
            timer = setTimeout(function () {
              fn.apply(self, args);
            }, delay);
          };
        }
docs: handle debouncing a function for better performance on scroll