title: getting property 'retValue' of undefined error in jquery plugin
body: <p>I have following jquery plugin code on which I working on but it gives me <code>Uncaught TypeError: Cannot read property 'retValue' of undefined</code>. Below is my code</p>
  
  <pre><code>(function ($) {
      var Plugin = {
          init: function (options, elem) {
              var self = this;
              self.elem = elem;
              self.$elem = $(elem);
  
              this.search = (typeof options === 'string') ? options:options.retValue;
              this.options = $.extend({}, $.fn.plugin.options, options);
          }
      };
  
      $.fn.plugin = function (options) {
          return this.each(function () {
              var plugin = Object.create(Plugin);
              plugin.init(options, this);
          });
      };
  
      $.fn.plugin.options = {
          retValue: 'value',
      };
  })(jQuery);
  
  $('#selector').plugin();
  </code></pre>
  
  <p>Here I am passing no parameters in border(). So I want my plugin to get the default <code>retValue</code> but it gives me above error. How can I solve this?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I want to use this plugin in 3 following ways.</p>
  
  <pre><code>$('#selector').plugin(); // does not work
  $('#selector').plugin('string'); // works
  $('#selector').plugin({key1: 'value1', key2: 'value2'}); // works
  </code></pre>
  
  <p><strong>How can I make first one work?</strong></p>