📅  最后修改于: 2022-03-11 15:04:47.555000             🧑  作者: Mango
people = {'joe' => 21, 'bill' => 35, 'sally' => 24}
people.min_by { |name, age| age } #=> ["joe", 21]
people.max_by { |name, age| age } #=> ["bill", 35]