-
[Ruby] hashes data typecoding for food 2022. 8. 4. 03:40
# good array data animals = ["dog", "cat", "fish", "bird", "rabbit"] # not so good array data person = ["Kim", 100, "New York", "burger", true ] # better as hash better_person = { "name" => "Kim", "age" => 100, "location" => "New York", "favoritFood" => "burger", "isHungry" => true } puts better_person["location"] --------------------------------- #=> New York