Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

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;