Skip to content

Instantly share code, notes, and snippets.

@thunder775
Created June 1, 2020 04:32
Show Gist options
  • Save thunder775/8699bf276fd30f1fd5e5006480bce8e2 to your computer and use it in GitHub Desktop.
Save thunder775/8699bf276fd30f1fd5e5006480bce8e2 to your computer and use it in GitHub Desktop.
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