会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
Talk is cheap. Show me your code
Wise.Wrong
不懂交互的前端不是好全栈
博客园
首页
新随笔
联系
管理
2022年6月12日
使用 localeCompare 对数组排序时顺序错乱
摘要: 问题描述: 使用 localeCompare 对一个字符串数组按名称排序 const arr = ['我', 'B', 'c', 'C', 'b', '干活', '233', '1024', '211', '吃饭']; arr.sort((a, b) => a.localeCompare(b));
阅读全文
posted @ 2022-06-12 10:26 Wise.Wrong
阅读(554)
评论(0)
推荐(0)
编辑
公告