4 ms·
I couldn't resist... Your example could be improved by using "products.sort_by(&:cost).last" I try to not use map because often there are methods that already
by klohto 8y ago
I couldn't resist...
Your example could be improved by using "products.sort_by(&:cost).last"
I try to not use map because often there are methods that already implement filtering.
Gotta love Ruby readability.