// 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));
const guessNumber = 8
const correctAnswer = 8
const message = guessNumber > correctAnswer ? 'The Guess was too High!'
: (guessNumber < correctAnswer) ? 'The Guess was too low!'
: 'Perfect guess!'
console.log(message)
var foo = (
bar === 'a' ? 1 : // if
bar === 'b' ? 2 : // else if
bar === 'c' ? 3 : // else if
null // else
);
var icon = (area == 1) ? icon1 : (area == 2) ? icon2 : icon0;