2 * The inverse of `_.toPairs`; this method returns an object composed
3 * from key-value `pairs`.
8 * @param {Array} pairs The key-value pairs.
9 * @returns {Object} Returns the new object.
12 * _.fromPairs([['fred', 30], ['barney', 40]]);
13 * // => { 'fred': 30, 'barney': 40 }
15 function fromPairs(pairs) {
17 length = pairs ? pairs.length : 0,
20 while (++index < length) {
21 var pair = pairs[index];
22 result[pair[0]] = pair[1];
27 module.exports = fromPairs;