mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Cleanup arrayConcat and wrapperConcat docs. [ci skip]
This commit is contained in:
@@ -1335,25 +1335,25 @@
|
|||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new array joining `array` with `values`.
|
* Creates a new array joining `array` with `other`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array} array The array to join with `values`.
|
* @param {Array} array The array to join.
|
||||||
* @param {Array} values The values to join with `array`.
|
* @param {Array} other The other array to join.
|
||||||
* @returns {Array} Returns the new concatenated array.
|
* @returns {Array} Returns the new concatenated array.
|
||||||
*/
|
*/
|
||||||
function arrayConcat(array, values) {
|
function arrayConcat(array, other) {
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = array.length,
|
length = array.length,
|
||||||
valsIndex = -1,
|
othIndex = -1,
|
||||||
valsLength = values.length,
|
othLength = other.length,
|
||||||
result = Array(length + valsLength);
|
result = Array(length + othLength);
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
result[index] = array[index];
|
result[index] = array[index];
|
||||||
}
|
}
|
||||||
while (++valsIndex < valsLength) {
|
while (++othIndex < othLength) {
|
||||||
result[index++] = values[valsIndex];
|
result[index++] = other[othIndex];
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -6072,12 +6072,12 @@
|
|||||||
* @name concat
|
* @name concat
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @category Chain
|
* @category Chain
|
||||||
* @param {...*} [values] The arrays and/or values to concatenate.
|
* @param {...*} [values] The values to concatenate.
|
||||||
* @returns {Array} Returns the new concatenated array.
|
* @returns {Array} Returns the new concatenated array.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* var array = [1, 2];
|
* var array = [1, 2];
|
||||||
* var wrapper = _(array).concat([3, 4]);
|
* var wrapper = _(array).concat([3], 4);
|
||||||
*
|
*
|
||||||
* console.log(wrapper.value());
|
* console.log(wrapper.value());
|
||||||
* // => [1, 2, 3, 4]
|
* // => [1, 2, 3, 4]
|
||||||
|
|||||||
Reference in New Issue
Block a user