我有一个这样的数组
let years =[
{id: 3, name: "2016", age: "None"},
{id: 1, name: "2017", age: "None"},
{id: 2, name: "2015", age: "None"},
{id: 5, name: "2018", age: "None"},
{id: 3, name: "2018/2019", age: "None"}
]
years.sort((c1, c2) => {
return c2.name - c1.name;
});
console.log(years);
我无法处理这种“2018/2017”方式我该怎么做最好的方法是什么
MM们
Qyouu
慕容森
红糖糍粑
相关分类