1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 1 1 1 1 3 2 1 1 | define(['./indexOf'], function (indexOf) { /** * Combines an array with all the items of another. * Does not allow duplicates and is case and type sensitive. */ function combine(arr1, arr2) { var x, length = arr2.length; for (x = 0; x < length; x++) { if (indexOf(arr1, arr2[x]) === -1) { arr1.push(arr2[x]); } } return arr1; } return combine; }); |