js使用中文集进行排序

Array.prototype.sort((a, b)=> a.localeCompare(b))
### 举个例子
['b', 'a', 'd', 'c'].sort((a, b) => a.localeCompare(b))
posted @ 2024-05-22 14:25  HuangBingQuan  阅读(2)  评论(0编辑  收藏  举报