Check number is positive, negative or zero using ternary operator

PHOTO EMBED

Mon May 31 2021 19:59:43 GMT+0000 (Coordinated Universal Time)

Saved by @uditsahani #javascript

function checkSign(num){
    
return num > 0 ? "Postive": num<0 ? "Negative": "zero";
}

console.log(checkSign(0));
content_copyCOPY