This is the result of the console output, with the most simple array object sorting method, the blue part can sort but not green, I think the question should be out in the red part, do you have any good solution???????
Newlist is output, here is the code, ` ` ` The console. The log (newlist. Sort (function (a, b) {return a.r ating - b.r ating}))
` ` `
Thank you very much!
CodePudding user response:
Make sure each array element has a first rating this property, you can in the sorting method, the print look at each element of the rating value