hash

« BACK TO DICTIONARY INDEX

(n.) A collection of data in which each piece has two components, a key and a value. It is also known as an associative array. In JavaScript a hash is unordered, not indexed by numbers, as is a normal array. To assign a different graphic to each month in a calendar, all the graphics could be placed into a hash associhash
5th harmonic
4th harmonic
3rd harmonic
2nd harmonic
fundamental
harmonics
ated with each month as a key. A reference to the key month would invoke the graphic for that month. In a normal array, a number would be used as the index for the month:
picture[0] = “Snow”;
picture[1] = “Valentine”;
picture[3] = “Clover”;
picture[4] = “Showers”;
In a hash, a string with the name of the month is used as the index:
picture[“January”] = “Snow”;
picture[“February”] = “Valentine”;
picture[“March”] = “Clover”;
picture[“April”] = “Showers”;