add hw2
This commit is contained in:
		
							
								
								
									
										28
									
								
								node_modules/lodash-es/fromPairs.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								node_modules/lodash-es/fromPairs.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| /** | ||||
|  * 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 | ||||
|  * | ||||
|  * _.fromPairs([['a', 1], ['b', 2]]); | ||||
|  * // => { 'a': 1, 'b': 2 } | ||||
|  */ | ||||
| function fromPairs(pairs) { | ||||
|   var index = -1, | ||||
|       length = pairs == null ? 0 : pairs.length, | ||||
|       result = {}; | ||||
|  | ||||
|   while (++index < length) { | ||||
|     var pair = pairs[index]; | ||||
|     result[pair[0]] = pair[1]; | ||||
|   } | ||||
|   return result; | ||||
| } | ||||
|  | ||||
| export default fromPairs; | ||||
		Reference in New Issue
	
	Block a user
	 nik
					nik