A developer implemented the below function that determines if a given number is positive, negative, or zero. Consider the following code which relies on the ternary operator:
function determineSign(num){
return (num>0)?"Positive":(num<0)?"Negative":"Zero";
}
console.log(determineSign(-5)+" and "+determineSign(0)+" and "+determineSign(10)) What will be the output of the above code snippet?
Zero and Negative and Positive
Negative and Zero and Positive
Positive and Zero and Negative
SyntaxError
To get all Infosys Certified JavaScript Professional Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee