What might be a reason of overriding function using jQuery.extend?
问题 I was searching for a proper way of extending bootstrap plugin, and found this answer: https://stackoverflow.com/a/12689534/1276032 What troubles me, is the last section - initialization overriding. Copied code below: // override the old initialization with the new constructor $.fn.modal = $.extend(function(option) { var args = $.makeArray(arguments), option = args.shift(); return this.each(function() { var $this = $(this); var data = $this.data('modal'), options = $.extend({}, _super