Created
May 5, 2018 21:48
-
-
Save MorenoMdz/2bcaeb58e70e2cfaffeffb1b2fec1ed3 to your computer and use it in GitHub Desktop.
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
| /** | |
| * | |
| This challenge requires you to return the string "true" if the second integer parameter (num2) is larger than the first (num1). This is actually a very simple challenge which doesn't require a lot of code. | |
| */ | |
| function CheckNums(num1, num2) { | |
| if (num2 > num1) { | |
| return true; | |
| } | |
| return false; | |
| } | |
| /* 1 */ | |
| function CheckNums(num1, num2) { | |
| if (num1 == num2) { | |
| return "-1"; | |
| } else { | |
| return num2 > num1; | |
| } | |
| } | |
| /* 2 */ | |
| function CheckNums(num1, num2) { | |
| // code goes here | |
| if (num1 - num2 < 0) return true; | |
| else if (num1 - num2 > 0) return false; | |
| else return -1; | |
| } | |
| /* 3 */ | |
| function CheckNums(num1, num2) { | |
| if (num2 > num1) { | |
| return "true"; | |
| } else if (num2 === num1) { | |
| return "-1"; | |
| } else { | |
| return "false"; | |
| } | |
| } | |
| /* 4 */ | |
| function CheckNums(num1, num2) { | |
| if (num1 === num2) { | |
| return -1; | |
| } | |
| if (num1 > num2) { | |
| return false; | |
| } else { | |
| return true; | |
| } | |
| } | |
| /* 5 */ | |
| function CheckNums(num1, num2) { | |
| if (num1 - num2 < 0) { | |
| return "true"; | |
| } else if (num1 == num2) { | |
| return "-1"; | |
| } else { | |
| return "false"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment