Quick question-Can someone explain plz?

function checkSign(num) {

return (num === 0) ? “zero” : (num < 0) ? “negative” : (num > 0) ? “positive”: “”

}

checkSign(10);

At first, it did not work, than I tried the following line: “positive”: “”
Before, I had stopped at: “positive”;

Id like to understand that logic behind it, because the example given was:

function findGreaterOrEqual(a, b) {
  return (a === b) ? "a and b are equal" : (a > b) ? "a is greater" : "b is greater";
}

Every question mark has to have a corresponding colon. Your original code sounds like it didn’t have a colon to match the last question mark. You could have also done it like this:

return (num === 0) ? "zero" : (num < 0) ? "negative" : "positive";

Hope that helps!