数组内容按照首字母排序

let as = ['s','d']

as.sort((a,b)=>a>b?0:-1)


// ['d', 's']

 

posted @ 2022-07-28 11:31  SimoonJia  阅读(24)  评论(0编辑  收藏  举报