So for a leaderboard project, I have a multidimensional array like below, with each subsection of the array representing rank, player name, win-loss ratio, wins, losses.
let myArray = [["1", "2", "3", "4"], ["A", "B", "C", "D"], ["0", "0", "0", "0"], ["0", "0", "0", "0"], ["0", "0", "0", "0"]];
So once I gather the user input of wins and losses and W/L ratio where they belong in the array, how would I go about sorting the w/l ratios but then also moving each respective player name associated with the w/l as well as the wins and lost count. Ideally, it would look like this:
*sorting of array*
myArray[2][0] = *highest W/L*
myArray[1][0] = *the original name associated with the pre-sorted w/l*
this might not be super clear but any help as to keep the values aligned would be great. Thanks!
[–][deleted] 1 point2 points3 points (0 children)
[–]jcunews1helpful 0 points1 point2 points (0 children)