function zipObject(array1, array2) {
  if (!Array.isArray(array1) && !Array.isArray(array2)) {
    throw new TypeError('Both parameters must be an array');
  }

  return Object.fromEntries(array1.map((_, i) => ([array1[i], array2[i]])));
}
@param {Array} array1    First array
@param {Array} array2    Second array
@returns {object}        The zipped Object