Order elements in a for loop

This example will take all of the subpages (as an array assigned to "subpages") and sort them alphabetically by the headline title. This can be updated/changed to be other elements of the child pages to sort on (ex. title)