js ternaire with equal code example
Example 1: ternary function javascript
var variable;
if (condition)
variable = "something";
else
variable = "something else";
//is the same as:
var variable = condition ? "something" : "something else";
Example 2: ternary
isMember ? '$2.00' : '$10.00'
// isMember true => output: "$2.00"
// isMember false => output: "$10.00"
// isMember null => output: "$10.00"