Hash Tables - 401-advanced-javascript-muna/amman-javascript-401d1 GitHub Wiki

Hash Tables

  1. Hash - A hash is the result of some algorithm taking an incoming string and converting it into a value that could be used for either security or some other purpose. In the case of a hashtable, it is used to determine the index of the array.

  2. Buckets - A bucket is what is contained in each index of the array of the hashtable. Each indicie is a bucket. An indicie could potentially contain multiple key/value pairs if a collision occurs.

  3. Collisions - A collision is what happens when more than one key gets hashed to the same location of the hashtable.

Used for:

  1. Hold unique values
  2. Dictionary
  3. Library