code: function debounce(func, wait, options) {
        var args,
            inited,
            result,
            thisArg,
            timeoutId,
            trailing = true;
  
        function delayed() {
          inited = timeoutId = null;
          if (trailing) {
            result = func.apply(thisArg, args);
          }
        }
        if (options === true) {
          var leading = true;
          trailing = false;
        } else if (options && objectTypes[typeof options]) {
          leading = options.leading;
          trailing = 'trailing' in options ? options.trailing : trailing;
        }
        return function() {
          args = arguments;
          thisArg = this;
          clearTimeout(timeoutId);
  
          if (!inited && leading) {
            inited = true;
            result = func.apply(thisArg, args);
          } else {
            timeoutId = setTimeout(delayed, wait);
          }
          return result;
        };
      }
docs: Creates a function that will delay the execution of `func` until after
  `wait` milliseconds have elapsed since the last time it was invoked. Pass
  an `options` object to indicate that `func` should be invoked on the leading
  and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced
  function will return the result of the last `func` call.
  
  Note: If `leading` and `trailing` options are `true`, `func` will be called
  on the trailing edge of the timeout only if the the debounced function is
  invoked more than once during the `wait` timeout.
  
  @static
  @memberOf _
  @category Functions
  @param {Function} func The function to debounce.
  @param {Number} wait The number of milliseconds to delay.
  @param {Object} options The options object.
  [leading=false] A boolean to specify execution on the leading edge of the timeout.
  [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
  @returns {Function} Returns the new debounced function.
  @example
  
  var lazyLayout = _.debounce(calculateLayout, 300);
  jQuery(window).on('resize', lazyLayout);
  
  jQuery('#postbox').on('click', _.debounce(sendMail, 200, {
  'leading': true,
  'trailing': false
  });