The requirement for the jQuery
trigger
function is that the second parameter is an array (up to 1.6.2), so wrapping makes it an array. From trigger documents (underline me):
$('#foo').bind('custom', function(event, param1, param2) { alert(param1 + "\n" + param2); }); $('#foo').trigger('custom', ['Custom', 'Event']);
The event object is always passed as the first parameter for the handler event, but if additional parameters are specified during .trigger (), these parameters will be passed along with the handler as well. To pass multiple parameters, use an array as shown here. Starting with jQuery 1.6.2, one parameter can be passed without using an array.
So, starting with 1.6.2, there is virtually no need to wrap a single argument in an array.
source share