solution logic fixed for negative numbers (#36093)
This commit is contained in:
committed by
Randell Dawson
parent
b55c50c6cf
commit
53fd5d8c14
@ -19,7 +19,7 @@ Here’s a full solution:
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
function checkSign(num) {
|
function checkSign(num) {
|
||||||
return (num > 0) ? "positive" : (num < -12) ? "negative" : "zero";
|
return (num > 0) ? "positive" : (num < 0) ? "negative" : "zero";
|
||||||
}
|
}
|
||||||
checkSign(10);
|
checkSign(10);
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user