ternary function with 3 conditions code example
Example 1: Use Multiple Conditional Ternary Operators Javascript
// Use Multiple Conditional Ternary Operators Javascript.
function checkSign(num) {
return num > 0 ? "positive" : num < 0 ? "negative" : "zero";
}
console.log(checkSign(10));
console.log(checkSign(-10));
console.log(checkSign(0));
Example 2: ternary operator in javascript
FullName: (obj.FirstName && obj.LastName) ? obj.FirstName + " " + obj.LastName : "missing values",