-
[Ruby] hashescoding for food 2022. 8. 4. 00:55
Data structure - Hashes
'key => value' pairs
my_hash = { "name" => "App Academy", "color" => "red", "age" => 5 } puts my_hash["name"] my_hash["color"] = "pink" puts my_hash my_hash["age"] += 1 puts my_hash -------------------------------- #=> App Academy {"name"=>"App Academy", "color"=>"pink", "age"=>5} {"name"=>"App Academy", "color"=>"pink", "age"=>6}