Understanding Array.prototype.slice.call( arguments, 1 )

$.fn.show_blog = function( method ) {
// Method calling logic
if ( methods[method] ) {
//Array.prototype.slice.call( arguments, 1 ): convert object to array and return an array excluding the first item
return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof method === ‘object’ || ! method ) {
//Call default method init()
return methods.init.apply( this, arguments );
} else {
$.error( ‘Method ‘ + method + ‘ does not exist on jQuery.tooltip’ );
}
};

6 thoughts on “Understanding Array.prototype.slice.call( arguments, 1 )

  1. online pokies

    Τo lionizе, the Korean companiοnship is unleаshіng ωаndering platformѕ, whiсh are
    immense for Online Pokies, and bring themsеlves cоmfortably to the “snack”-like gamеplaу that dοminаtes on these deѵices.

  2. news feed

    Wow! Thank you! I continuously wanted to write on my site something like that. Can I include a part of your post to my site?

  3. anna

    A motivating discussion is definitely worth comment.
    There’s no doubt that that you should write more about this topic, it might not be a taboo subject but generally folks don’t talk about such issues.
    To the next! Cheers!!

Comments are closed.