1// Use Multiple Conditional Ternary Operators Javascript.
2
3
4function checkSign(num) {
5
6 return num > 0 ? "positive" : num < 0 ? "negative" : "zero";
7
8}
9
10console.log(checkSign(10));
11console.log(checkSign(-10));
12console.log(checkSign(0));
1var foo = (
2 bar === 'a' ? 1 : // if
3 bar === 'b' ? 2 : // else if
4 bar === 'c' ? 3 : // else if
5 null // else
6);
7