Created
May 1, 2018 05:47
-
-
Save Luke-Rogerson/db14e29b8e111c98ce7ae0a16341ac09 to your computer and use it in GitHub Desktop.
CheckNums algorithm challenge created by Luke_Rogerson - https://repl.it/@Luke_Rogerson/CheckNums-algorithm-challenge
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
/* | |
have the function CheckNums(num1,num2) take both parameters being passed and return the string true if num2 is greater than num1, otherwise return the string false. If the parameter values are equal to each other then return the string -1. | |
*/ | |
function CheckNums (num1, num2) { | |
if (num2 > num1) { | |
return true; | |
} | |
else if (num1 == num2) { | |
return -1; | |
} | |
else { | |
return false; | |
} | |
} | |
CheckNums(5,5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment