UNPKG

624 BJavaScriptView Raw
1/**
2 * Creates a new array concatenating `array` with `other`.
3 *
4 * @private
5 * @param {Array} array The first array to concatenate.
6 * @param {Array} other The second array to concatenate.
7 * @returns {Array} Returns the new concatenated array.
8 */
9function arrayConcat(array, other) {
10 var index = -1,
11 length = array.length,
12 othIndex = -1,
13 othLength = other.length,
14 result = Array(length + othLength);
15
16 while (++index < length) {
17 result[index] = array[index];
18 }
19 while (++othIndex < othLength) {
20 result[index++] = other[othIndex];
21 }
22 return result;
23}
24
25export default arrayConcat;