UNPKG

418 BJavaScriptView Raw
1
2
3 /**
4 * Appends an array to the end of another.
5 * The first array will be modified.
6 */
7 function append(arr1, arr2) {
8 if (arr2 == null) {
9 return arr1;
10 }
11
12 var pad = arr1.length,
13 i = -1,
14 len = arr2.length;
15 while (++i < len) {
16 arr1[pad + i] = arr2[i];
17 }
18 return arr1;
19 }
20 module.exports = append;
21