* The inverse of `_.toPairs`; this method returns an object composed * from key-value `pairs`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. * @example
(pairs)
| 7486 | * // => { 'a': 1, 'b': 2 } |
| 7487 | */ |
| 7488 | function fromPairs(pairs) { |
| 7489 | var index = -1, |
| 7490 | length = pairs == null ? 0 : pairs.length, |
| 7491 | result = {}; |
| 7492 | |
| 7493 | while (++index < length) { |
| 7494 | var pair = pairs[index]; |
| 7495 | baseAssignValue(result, pair[0], pair[1]); |
| 7496 | } |
| 7497 | return result; |
| 7498 | } |
| 7499 | |
| 7500 | /** |
| 7501 | * Gets the first element of `array`. |
nothing calls this directly
no test coverage detected