Tell us what’s happening:
It says to Use multiple conditional operators in the checkSign function to check if a number is positive, negative or zero. I’ve been stuck on this for nearly an hour trying stuff so I’d appreciate some help.
Your code so far
function checkSign(num) {
return (num>=0?(num>0 ? "positive":"zero"):"negative");
}
checkSign(10);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36.
I believe FCC’s validation is interpreting your solution as a single conditional because you have the “second” conditional inside the “if” clause of the ternary. And it is expecting it to be in the “else” clause.
Just rework your logic a little bit and I bet it will let you pass. Sometimes the lessons are a little finicky.