Created
June 1, 2020 04:32
-
-
Save thunder775/8699bf276fd30f1fd5e5006480bce8e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
res.sort(([teamAName,teamAPoints,teamAGoals,teamAGD],[teamBName,teamBPoints,teamBGoals,teamBGD])=>{ | |
if(teamAPoints!==teamBPoints) return teamBPoints-teamAPoints; | |
else if(teamAGoals!==teamBGoals) return teamBGoals-teamAGoals; | |
else return teamBGD-teamAGD | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment