Use Multiple Conditional (Ternary) Operators not working

Please could somebody help with this?
My code below doesn’t seem to be working,please could one of you kind people correct me? I’m baffled!!!

What am I doing wrong?
Many thanks.

Your code so far
function checkSign(num) {
return (num > 0) ? “positve” : (num < 0) ? “negative” : (num === 0) ? “zero”;
}

checkSign(10);


function checkSign(num) {
  return (num > 0) ? "positve" : (num < 0) ? "negative" : (num === 0) ? "zero";
}

checkSign(10);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/use-multiple-conditional-ternary-operators

Look at this topic: Problem with exercise: Use Multiple Conditional (Ternary) Operators
This user had the same issue that you are having.

Aha many thanks,was two simple errors,the first being a simple typo and the second being the last condition not being needed.
Sometimes it is amazing how something which seems so testing turns into something so obvious yet I overlooked it.
Lesson learned !!!
Thank you!!!

1 Like