// 按字典排序(中文排序)
const cityArr = ['湖北', '广州', '上海', '重庆', '厦门'];
function changeCity(arr, callback) {
callback(arr.sort((a, b)=> {
return a.localeCompare(b)
}))
}
changeCity(cityArr, (resCityArr)=> {
console.log(resCityArr);
})
标签:中文,arr,callback,resCityArr,排序,字典
From: https://www.cnblogs.com/bingquan1/p/17001940.html