forked from ratracegrad/coderbyte-Beginner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCheck Nums
32 lines (29 loc) · 1.86 KB
/
Check Nums
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/***************************************************************************************
* *
* CODERBYTE BEGINNER CHALLENGE *
* *
* First Factorial *
* Using the JavaScript language, 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 *
* *
* SOLUTION *
* This solution has to use an If...else if...else statement since you will be *
* comparing for three different comparisons.
* *
* Steps for solution *
* 1) If num1 and num2 are equal then return string -1 *
* 2) Else If num2 is greater than num1 then return true *
* 3) Else return false *
* *
***************************************************************************************/
function CheckNums(num1,num2) {
if (num1 === num2) {
return "-1";
} else if (num2 > num1) {
return true;
} else {
return false;
}
}