Introduction
We use sorted and sortedBy to arrange items in a list in order. This helps us find things faster or show them nicely.
When you want to show a list of names in alphabetical order.
When you need to organize numbers from smallest to largest.
When you want to sort objects by one of their properties, like sorting people by age.
When you want to prepare data for reports or display in a neat order.