I heard that the positions of the key value pairs in a hash are not fixed, and could be rearranged.
I would like to know if this is true, and if it is, could someone point me to some documentation? If it is wrong, it would be great to have some documentation to the contrary.
To illustrate, if I have the following hash:
NUMBERS = {
1000 => "M",
900 => "CM",
500 => "D",
400 => "CD",
100 => "C",
90 => "XC",
50 => "L",
40 => "XL",
10 => "X",
9 => "IX",
5 => "V",
4 => "IV",
1 => "I",
}
and iterate through it over and over again, would the first key/value pair possibly not be 1000 => 'M'
? Or, are the positions of the key/value pairs fixed by definition, and would have to be manually changed in order for the positions to change?
This question is a more general and basic question about the qualities of hashes. I'm not asking how to get to a certain position in a hash.