condition check for two expressions javascript code example
Example 1: single if statement js true false
condition ? exprIfTrue : exprIfFalse
Example 2: examples of Conditional Operator js
var age = 19;
var canDrive = age > 16 ? 'yes' : 'no';
condition ? exprIfTrue : exprIfFalse
var age = 19;
var canDrive = age > 16 ? 'yes' : 'no';