code: function arrayToHash(arr, keyProperty) {
      if (arr.length === 0) {
          return {};
      }
      const isScalar = typeof arr[0] === "object" ? false : true;
      if (isScalar && keyProperty) {
          const e = new Error(`You can not have an array of primitive values AND set a keyProperty!`);
          e.name = "NotAllowed";
          throw e;
      }
      if (!keyProperty && !isScalar) {
          if (arr[0].hasOwnProperty("id")) {
              keyProperty = "id";
          }
          else {
              const e = new Error(`Tried to default to a keyProperty of "id" but that property does not appear to be in the array passed in`);
              e.name = "NotAllowed";
              throw e;
          }
      }
      if (!Array.isArray(arr)) {
          const e = new Error(`arrayToHash: input was not an array!`);
          e.name = "NotAllowed";
          throw e;
      }
      const output = arr.reduce((prev, curr) => {
          const key = isScalar
              ? curr
              : typeof keyProperty === "function"
                  ? keyProperty(curr)
                  : curr[keyProperty];
          return isScalar
              ? Object.assign({}, prev, { [key]: true }) : Object.assign({}, prev, { [key]: curr });
      }, {});
      return output;
  }
docs: arrayToHash
  
  Converts an array of things into a hash/dictionary where "things" is a consistent
  type of data structure (can be either object or primitive)
  
  @param arr an array of a particular type
  @param keyProperty the property that will be used as the dictionaries key; if false then will assign a firebase pushkey