ternary operator 3 conditions javascript code example
Example 1: multiple ternary operator javascript
var icon = (area == 1) ? icon1 : (area == 2) ? icon2 : icon0;
Example 2: ternary operator if javascript
condition ? exprIfTrue : exprIfFalse
var icon = (area == 1) ? icon1 : (area == 2) ? icon2 : icon0;
condition ? exprIfTrue : exprIfFalse