升序
let arr = [1,2, 5, 3, 6, 4, 7] arr.sort((a,b)=>{ return a-b }) console.log(arr)
降序
let arr = [1,2, 5, 3, 6, 4, 7] arr.sort((a,b)=>{ return b-a }) console.log(arr)