按字母顺序排序数组:Coffeescript

时间:2014-08-23 05:14:13

标签: coffeescript

我有一个数组说myArray = ["Manu","Anju","Zamya","Bijoy"]

如何使用coffeescript按字母顺序对此数组进行排序?

预期输出:myArray = ["Anju","Bijoy","Manu","Zamya"]

1 个答案:

答案 0 :(得分:2)

看不到问题,这与js sort功能相同:myArray.sort()