- 按字母顺序排列 - sort list alphabetically
var items = ['asad', 'asddd', 'qwe', 'cafe', 'aac', 'accc'];
console.log(items.sort(function (a, b) {
return a.localeCompare(b); //using String.prototype.localCompare()
}));
//["aac", "accc", "asad", "asddd", "cafe", "qwe"]