index.js 284 B

1234567891011121314151617
  1. var zipObject = function (keys, values) {
  2. if (arguments.length == 1) {
  3. values = keys[1];
  4. keys = keys[0];
  5. }
  6. var result = {};
  7. var i = 0;
  8. for (i; i < keys.length; i += 1) {
  9. result[keys[i]] = values[i];
  10. }
  11. return result;
  12. };
  13. module.exports = zipObject;