Sorting a new array from an existing array (emergency!)


i got an existing array, main[y], which after an equation, will come out with another array.

 if (main[y] === topicList.getValue()){
 subTopic = [];
 subTopic = fTitle[y]

However, i could not sort the subTopic, as it gkeep giving me undefined. Is there any way to sort this subTopic, such that they are in alphabetical orders?

Appreciate any help.