What does this Code do?
<p>i'm reading through <a href="http://docs.jquery.com/Plugins/Authoring" rel="nofollow">jQuery's "Plugins/Authoring"</a> though i already wrote a few jQuery-Plugins. Now I see that jQuery has a special way of scoping the methods and calling:</p>

<pre><code>(function( $ ){

  var methods = {
    init : function( options ) { // THIS },
    show : function( ) { // IS   },
    hide : function( ) { // GOOD },
    update : function( content ) { // !!! }
  };

  $.fn.tooltip = function( method ) {

    // Method calling logic
    if ( methods[method] ) {
      return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
    } else if ( typeof method === 'object' || ! method ) {
      return methods.init.apply( this, arguments );
    } else {
      $.error( 'Method ' +  method + ' does not exist on jQuery.tooltip' );
    }    

  };

})( jQuery );
</code></pre>

<p>I understand the concept of what will happen in the end… but how exactly? This part is what confuses me:</p>

<pre><code>    // Method calling logic
    if ( methods[method] ) {
      return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
    } else if ( typeof method === 'object' || ! method ) {
      return methods.init.apply( this, arguments );
    }
</code></pre>

<p>Why <code>Array.prototype.slide.call(argumetns, 1)</code>? And where does the variable "arguments" come from all of the sudden? Any brief or deeper explanation is much appreciated. It is said, that this is how plugins should be written… so i'd like to know why.</p>

<p>Thanks!</p>
