mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Remove semicolons.
This commit is contained in:
18
fromPairs.js
18
fromPairs.js
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* The inverse of `toPairs`; this method returns an object composed
|
||||
* The inverse of `toPairs`is method returns an object composed
|
||||
* from key-value `pairs`.
|
||||
*
|
||||
* @since 4.0.0
|
||||
@@ -8,19 +8,19 @@
|
||||
* @returns {Object} Returns the new object.
|
||||
* @example
|
||||
*
|
||||
* fromPairs([['a', 1], ['b', 2]]);
|
||||
* fromPairs([['a', 1], ['b', 2]])
|
||||
* // => { 'a': 1, 'b': 2 }
|
||||
*/
|
||||
function fromPairs(pairs) {
|
||||
let index = -1;
|
||||
const length = pairs == null ? 0 : pairs.length;
|
||||
const result = {};
|
||||
let index = -1
|
||||
const length = pairs == null ? 0 : pairs.length
|
||||
const result = {}
|
||||
|
||||
while (++index < length) {
|
||||
const pair = pairs[index];
|
||||
result[pair[0]] = pair[1];
|
||||
const pair = pairs[index]
|
||||
result[pair[0]] = pair[1]
|
||||
}
|
||||
return result;
|
||||
return result
|
||||
}
|
||||
|
||||
export default fromPairs;
|
||||
export default fromPairs
|
||||
|
||||
Reference in New Issue
Block a user