SORT ACTORS
To sort any objects, we need to compare them by some parameter. Let’s first try to sort the actors by name.
You can also choose any other criterion for comparison. If you need a function to sort objects according to various parameters, you can create many comparison functions and select them by passing some key, for example, Enum.
Example:





