It happens that when working with Javascript frameworks like MooTools for a long time, it’s easy to forget how to do things in plain/native Javascript. For example, concatenating arrays is an easy task thanks to the Function object method apply:
-
var array1 = [1,2,3,4];
-
var array2 = [5,6,7];
-
array1.push.apply(array1, array2); // array1 = [1, 2, 3, 4, 5, 6, 7]
-
array1.push.apply(array1, [1,2,3]); // array1 = [1, 2, 3, 4, 5, 6, 7, 1, 2, 3]
Note that this method concatenates two arrays, and does not check for duplicate items.
In MooTools, the equivalent to this method would be Array.extend():
-
var array1 = [1,2,3,4];
-
var array2 = [5,6,7];
-
array1.extend(array2); // array1 = [1, 2, 3, 4, 5, 6, 7]
-
array1.extend([1,2,3]); // array1 = [1, 2, 3, 4, 5, 6, 7, 1, 2, 3]
Again, Array.extend() concatenates two arrays without checking for duplicates.

I’ve been using this.
But your wheel looks nice too. :)
Yeah, that’s another way, hahaha. Always reinventing the wheel, you see?
Actually, Caleb, after doing some testing with concat (hard to admit I’ve never used it before), I’ve notice there is a big difference between push.apply and concat: push updates the current array, so there is no need for an assignment while concat creates a brand new array with the sum of the other two.
Although having to do an assignment or not is not a big issue, creating brand new arrays may break some references to the existing array elements, if you had any in your code.
Yup, just depends on which one you’re going for.