JavaScript:
let row=[
{id:"1",name:"张三",age:"12"},
{id:"2",name:"李四",age:"10"},
{id:"3",name:"王五",age:"52"},
{id:"4",name:"赵六",age:"32"}
]
用下面这个函数直接自动排序
row.sort(function (a,b){return a.age-b.age;})
let row=[
{id:"1",name:"李四",age:"10"},
{id:"2",name:"张三",age:"12"},
{id:"3",name:"赵六",age:"32"},
{id:"4",name:"王五",age:"52"}
]