Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Luke-Rogerson/db14e29b8e111c98ce7ae0a16341ac09 to your computer and use it in GitHub Desktop.
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
/*
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