Please I need your help here: Use Multiple Conditional (Ternary) Operators

Tell us what’s happening:
I don’t really know how to go about this

Your code so far


function checkSign(num) {
    return 10 == 10 ? "POSITIVE" : 10 < 0 ? "NEGETIVE" :  "ZERO";
    return -12 == -12 ? "NEGETIVE" : -12 > 0 ? "POSITIVE" : "ZERO";
    return 0 == 0 ? "ZERO" : 0 > 0 ? "POSITIVE" : "NEGETIVE";
    

}

checkSign(10);

Your browser information:

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

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

You are returning multiple operations, that’s not how you go about it. First try to solve the problem using regular if else statement block. When you do, try tu re-write your logic using the ternary operator, take a good look at the example showed in the challenge.

1 Like

Think of it like this…

if true, return this, else return that.

to expand to multiple, if true, return this, else if nextThingTrue return that, else return otherthing

1 Like

Once you have the logic straightened out, you will also need to change the strings you are using. The tests are looking for “positive”, “negative” (check your spelling!) and “zero” and are case-sensitive. :+1:

1 Like

Thank’s to you all I got it know
I really appreciate your help…