Most Important Thing to Understand About Hashes

Posted by Victoria Meng on March 11, 2018

The most important thing to understand about hashes is that they store data in key-value pairs.

In an array, values are automatically stored and referenced by indices - 0, 1, 2, etc.

Hashes allow a programmer to create custom references - keys - in which to store data.

Unlike array indices, which are always consecutive integers starting from 0, keys are either strings or symbols.