function arrayToObject(arr) {
  const obj = {};
  const keys = Object.keys(arr);
  let i;
  const len = keys.length;
  let key;
  for (i = 0; i < len; i++) {
    key = keys[i];
    obj[key] = arr[key];
  }
  return obj;
}
Convert an array to an object.

@param {Array<any>} arr - The array to convert to an object.

@returns An object with the same keys and values as the array.