static arrToObj(arr) {
    const result = {};
    for (let i = 0; i < arr.length; i += 1) {
      result[arr[i]] = 1;
    }
    return result;
  }
Static method to convert an array to a hashmap object.
@param {object[]} arr Input array.
@returns {object} Output object.