corrected conditionals (#29295)

previous version passed the tests, but were only relevant to the numbers  tested, not what the question was asking for.
This commit is contained in:
Resurreccion
2019-01-15 14:51:07 -08:00
committed by Tom
parent 3fa796094b
commit ff9ee6814b

View File

@ -11,7 +11,7 @@ Heres a solution:
In the function body we need to add multiple ```conditional operators``` - as in our lesson:
```javascript
{return (num === 10) ? "positive" : (num === -12) ? "negative" : "zero";}
{return (num > 0) ? "positive" : (num < 0) ? "negative" : "zero";}
```
In this way, function can check if a number is positive, negative or zero.
@ -19,7 +19,7 @@ Heres a full solution:
```javascript
function checkSign(num) {
return (num === 10) ? "positive" : (num === -12) ? "negative" : "zero";
return (num > 0) ? "positive" : (num < -12) ? "negative" : "zero";
}
checkSign(10);
```