Last change
on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
664 bytes
|
Line | |
---|
1 | var assignValue = require('./_assignValue'),
|
---|
2 | baseZipObject = require('./_baseZipObject');
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * This method is like `_.fromPairs` except that it accepts two arrays,
|
---|
6 | * one of property identifiers and one of corresponding values.
|
---|
7 | *
|
---|
8 | * @static
|
---|
9 | * @memberOf _
|
---|
10 | * @since 0.4.0
|
---|
11 | * @category Array
|
---|
12 | * @param {Array} [props=[]] The property identifiers.
|
---|
13 | * @param {Array} [values=[]] The property values.
|
---|
14 | * @returns {Object} Returns the new object.
|
---|
15 | * @example
|
---|
16 | *
|
---|
17 | * _.zipObject(['a', 'b'], [1, 2]);
|
---|
18 | * // => { 'a': 1, 'b': 2 }
|
---|
19 | */
|
---|
20 | function zipObject(props, values) {
|
---|
21 | return baseZipObject(props || [], values || [], assignValue);
|
---|
22 | }
|
---|
23 |
|
---|
24 | module.exports = zipObject;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.