Is it the same order in which the items were added to the Hash ?
The top of the Ruby 1.9.2 documentation for the Hash class declares:
Hashes enumerate their values in the order that the corresponding keys were inserted.
Cursory tests suggest that this does indeed apply to both Hash#keys
and Hash#values
, although the corresponding documentation for those methods doesn't seem to specify it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With