Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

zipObject.js 664B

123456789101112131415161718192021222324
  1. var assignValue = require('./_assignValue'),
  2. baseZipObject = require('./_baseZipObject');
  3. /**
  4. * This method is like `_.fromPairs` except that it accepts two arrays,
  5. * one of property identifiers and one of corresponding values.
  6. *
  7. * @static
  8. * @memberOf _
  9. * @since 0.4.0
  10. * @category Array
  11. * @param {Array} [props=[]] The property identifiers.
  12. * @param {Array} [values=[]] The property values.
  13. * @returns {Object} Returns the new object.
  14. * @example
  15. *
  16. * _.zipObject(['a', 'b'], [1, 2]);
  17. * // => { 'a': 1, 'b': 2 }
  18. */
  19. function zipObject(props, values) {
  20. return baseZipObject(props || [], values || [], assignValue);
  21. }
  22. module.exports = zipObject;