Created
May 22, 2019 04:42
-
-
Save stevewithington/3695c54653c6840142effd3762d39ca4 to your computer and use it in GitHub Desktop.
JavaScript Compare
This file contains hidden or 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
compare(a: number, b: number): number { | |
return a > b | |
? 1 | |
: a < b | |
? -1 | |
: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment