javascript inline return if boolean code example
Example 1: js inline if
var a = 2;
var b = 3;
var c = ((a < b) ? 'minor' : 'major');
Example 2: ternary function javascript
var variable;
if (condition)
variable = "something";
else
variable = "something else";
//is the same as:
var variable = condition ? "something" : "something else";