if string contains tenary variable js object code example
Example: ternary function javascript
var variable;
if (condition)
variable = "something";
else
variable = "something else";
//is the same as:
var variable = condition ? "something" : "something else";