rehash(newBucketSize = Math.max(this.size, this.buckets.length) * 2) {
    const newCapacity = nextPrime(newBucketSize);
    const newMap = new HashMap(newCapacity);

    // copy all values to the new map
    for (const key of this.keys()) {
      newMap.set(key, this.get(key));
    }

    const newArrayKeys = Array.from(newMap.keys());

    // override this map with the newMap
    this.reset(
      newMap.buckets,
      newMap.size,
      newMap.collisions,
      newArrayKeys,
      newArrayKeys.length,
    );
  }
Rehash means to create a new Map with a new (higher)
 capacity with the purpose of outgrowing collisions.
@param {integer} newBucketSize new bucket size by default
 is the 2x the amount of data or bucket size.