mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Simplify arrayToObject.
This commit is contained in:
committed by
jdalton
parent
f06c9d5b9b
commit
31b4a9197f
@@ -4025,15 +4025,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts `collection` to an array-like object.
|
* Converts `array` to a plain array-like object.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array|Object|string} collection The collection to convert.
|
* @param {Array} array The array to convert.
|
||||||
* @returns {Object} Returns the converted array-like object.
|
* @returns {Object} Returns the converted object.
|
||||||
*/
|
*/
|
||||||
function arrayToObject(collection) {
|
function arrayToObject(array) {
|
||||||
var result = { 'length': 0 };
|
var result = { 'length': 0 };
|
||||||
push.apply(result, toObject(collection));
|
push.apply(result, array);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user