I am currently doing a golf scorecard application and I'm looking to sort each players results array by their overall score.
e.g, if I have the following arrays:
array1 = {
name: "player1",
overall: -3
}
array2 = {
name: "player2",
overall: -1
}
How can I sort them so that I can output the rank of each player depending on who got the best score while also keeping the name value?
Any help would be greatly appreciated.
.sortmethod (var players = [{name: ...}, {name: ...}];).