Why is the code not working if the return and the ternary operator are not on the same line?
Your code so far
function checkSign(num) {
return
num > 0 ? 'positive' : num < 0 ? 'negative' : '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/78.0.3904.108 Safari/537.36
.
Challenge: Use Multiple Conditional (Ternary) Operators
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/use-multiple-conditional-ternary-operators