code: function throttle(fn, wait) {
          var timeout;
  
          return function() {
              var ctx = this,
                  args = arguments;
              if (!timeout) {
                  timeout = setTimeout(function() {
                      timeout = null;
                      fn.apply(ctx, args);
                  }, wait);
              }
          };
      }
docs: Throttle search