The MooTools fireEvent method allows us to pass extra parameters pretty simply. To pass a single parameter:

To pass multiple parameters, we have to use an array:

However, what if you want to pass a single parameter that happens to be an array? For example, if you have this callback:

And it was bound as a listener:

And you fired it with a simple array:

What would happen? You’d get an error that the passed parameter doesn’t have a method “each”? This is because the callback was fired with 2 parameters – Number instances with values of “1” and “2” – not an array with 2 elements.

It’s actually pretty easy to get around this – just pass your array wrapped in another, anonymous array:

Now your callback will receive an array of parameters, the first and only element is the array of numbers you initially wanted to send.

In my opinion, it’d have been a little more elegant to *require* parameters to be contained with an array (just like we do with Array.apply), but I guess they had their reasons (or not).