<Below this line, add a link to the EXACT exercise that you are stuck at.>


Query: When to use ‘sort’ and when to use ‘sort_by’ ? Both methods seem to take a block to define how to compare elements if necessary.


Found with google-search using
ruby sort vs sort_by


Seems to be partly a question of efficiency, and if a process is included in the comparison, use sort_by.


More importantly that you can NOT use 2 parameters in the sort_by
read the article mentioned in


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.