sort the array by sort. No matter what the sort is, it needs to be sorted from 1 according to the previous size order. Sort repeatedly forgets the back row according to the previous order, asking for great advice, and there are problems with several methods.
let arr = [{sort:-2, id: 9},{sort:0, id: 10},{sort:1, id:8},{sort:2, id:1},{sort:4, id: 5},{sort:4, id: 7},{sort:6, id: 6},];
let arrNew = [{sort:1, id: 9},{sort:2, id: 10},{sort:3, id:8},{sort:4, id:1},{sort:5, id: 5},{sort:6, id: 7},{sort:7, id: 6},]