【发布时间】:2018-11-20 10:53:32
【问题描述】:
下面是我的对象数组的示例,我应该按名称对它们进行排序。 js正常排序排序如下图,不过我的目标是按数值排序,例如:“1 ex, 2 ex, 3 ex, 4 ex, 11 ex ..”。有人可以帮我实现这一目标吗?
[{id: 588, name: "1 ex"}
{id: 592, name: "11 ex"}
{id: 607, name: "2 ex"}
{id: 580, name: "3 ex"}
{id: 596, name: "4 ex"}]
【问题讨论】:
-
你尝试了什么?请分享你的努力
-
类似的解决方案在这里stackoverflow.com/questions/15478954/…
标签: javascript sorting underscore.js collator