inline if statement code example
Example 1: js inline if
var a = 2;
var b = 3;
var c = ((a < b) ? 'minor' : 'major');
Example 2: ternary operator
(condition) ? (if true, do this) : (otherwise, do this)
var a = 2;
var b = 3;
var c = ((a < b) ? 'minor' : 'major');
(condition) ? (if true, do this) : (otherwise, do this)