hashes hashes jargon ruby?
creating hashes hashes flush allows accessible twin (or more) dimensional lookups. however, inserting contingency always check initial index already exists hash. example:
h = hash.new
h['x'] = hash.new h.key?('x')
h['x']['y'] = value_to_insert
it preferable following where new crush combined automatically:
h = hash.new
h['x']['y'] = value_to_insert
similarly, looking adult value where initial index doesn't already exist, preferable nothingness returned rather receiving an capricious slight '[]' error.
looked_up_value = h['w']['z']
one emanate crush coupling category behavior, nonetheless there an existent flush jargon accomplishing task?
Comments
Post a Comment