首页 > TAG信息列表 > namse

数组排序

// 排序方法compare (namse) { return (obj1, obj2) => { const val1 = obj1[namse] * 1 const val2 = obj2[namse] * 1 if (val1 < val2) { return 1 } else if (val1 > val2) { return -1 } else { return 0 } } // console.log(r