It looks like my previous answer was closer to the sign than I thought before.
Yes, this line passes arguments:
return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
Using .apply() , you can call a method, change its context ( this value) and give it a set of arguments instead of separate ones. It is convenient if you do not know how the arguments should be passed.
So you can break the above line as follows:
So, if the plugin is called like this:
$('.someElem').tooltip('destroy', 'someArg', 'anotherArg' );
The "destroy" method will be found in the code, the "destroy" slice is turned off for the Arguments object, and "destroy" is called, passing through the array of remaining arguments.
source share