// 升序
export function ascending(a,b){
if(a.sort !== undefined && a.sort !== null){
return a.sort - b.sort
}
return a-b
}
// 降序
export function descend(a,b){
if(a.sort !== undefined && a.sort !== null){
return b.sort - a.sort
}
return b-a
}
// 调用
const arr = [1,7,2]
const newArr = arr.sort(ascending)