Created
October 20, 2019 22:22
-
-
Save dottedsquirrel/6777d141169d8d38447398abee0dff57 to your computer and use it in GitHub Desktop.
sort() callback function
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
function sortNumbers(a, b) { | |
if (a > b) { | |
return 1; | |
} else if (b > a) { | |
return -1; | |
} else { | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment