js字符串数据排序


results = [
  {model:'CM201-2'},{model:'CM201-3'},{model:'CM201-6'},{model:'H1Ne-02-1'},{model:'MGV200'},{model:'UNT400G1'},

]

results.sort((a,b) => {return a.model.localeCompare(b.model)});

 

posted @ 2023-07-26 17:23  Steven_Rain  阅读(211)  评论(0编辑  收藏  举报