_hash(key) {
    let hash = 0;
    for (let i = 0; i < key.length; i++) {
      hash = (hash + key.charCodeAt(i) * i) % this.data.length;
    }
    return hash;
  }
/**
   * sample hash function that mimics memory address allocation in form of array index
   *
   * @param {*} key
   * @returns number to use as array index
   * @memberof HashTable
   * @private true
   */
sample hash function that mimics memory address allocation in form of array index
@param {*} key
@returns number to use as array index
@memberof HashTable
@private true
sample hash function that mimics memory address allocation in form of array index @param { * } key @returns number to use as array index @memberof HashTable @private true
_hash(key) {
    let hash = 0;
    for (let i = 0; i < key.length; i++) {
      hash = (hash + key.charCodeAt(i) * i) % this.data.length;
    }
    return hash;
  }
_hash ( key ) { let hash = 0 ; for ( let i = 0 ; i < key . length ; i ++ ) { hash = ( hash + key . charCodeAt ( i ) * i ) % this . data . length ; } return hash ; }
sample hash function that mimics memory address allocation in form of array index
 @param {*} key
 @returns number to use as array index
 @memberof HashTable
 @private true
sample hash function that mimics memory address allocation in form of array index @param { * } key @returns number to use as array index @memberof HashTable @private true