Use Multiple Conditional Operators 2018.08.1

Why my code wrong???

Your code so far

function checkSign(num) {
    return (num > 0) ? “positive” : (num < 0) ? “negative” : “zero”;


Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0.

Link to the challenge:

When using " instead of ,
it works.

Did you copy/paste the solution from somewhere else on the forum? The curly quotes are a typical result of doing that.

1 Like

Strings in JavaScript are defined using " or '. The “ is not a valid character for doing that so the code results in an error.