hashFunction(key) {
    const hashValue = HashMap.hashCode(key);
    const bucketIndex = hashValue % this.buckets.length;
    return bucketIndex;
  }
A hash function converts keys into array indices
@param {any} key
@returns {Number} array index given the bucket size