0

I am trying to sort the following json -

https://i.stack.imgur.com/hBJgt.png

I want it to sort it by "assists" which is one of the data keys inside "elements" and so it displays them from highest to lowest. Anyone know how this could be done?

The code below is the public api im fetching

var request2 = new XMLHttpRequest();
request2.open("GET", "https://cors- 
anywhere.herokuapp.com/https://fantasy.premierleague.com/api/bootstrap-static/", true);
request2.onload = function () {
var data2 = JSON.parse(this.response);
console.log(data2);
}
request2.send();

0 Answers0