Basic JavaScript - Use Multiple Conditional (Ternary) Operators

Don’t know what i’m missing.

Your code so far

function checkSign(num) {
  return (num > 0) ? "positvie" 
  : (num < 0) ? "negativie"
  : "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/120.0.0.0 Safari/537.36 Edg/120.0.0.0

Challenge Information:

Basic JavaScript - Use Multiple Conditional (Ternary) Operators

What’s the error message? Id double check the spelling.

// running tests

checkSign(10)

should return the string

positive

. Note that capitalization matters

checkSign(-12)

should return the string

negative

. Note that capitalization matters // tests completed

So check your spelling of both of those words.

i just copied and pasted camperbot’s solution, I read it side by side the only difference being camper did not have () and when i removed the () from my code manually it still gave same erro. just ended up copying camper’s solution and pasting and it passed, went back wrote my code again, did not pass. I’ll figure it out eventually though.

Misspelling

Misspelling

god i gotta stop doing these lessons after work. Im so sorry.

We’re here to give a second pail of eyes! Mistakes are learning

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.