ternary operator in js code example
Example 1: javascript ternary
// example:
age >= 18 ? `wine` : `water`;
// syntax:
// <expression> ? <value-if-true> : <value-if-false>
Example 2: examples of Conditional Operator js
var age = 19;
var canDrive = age > 16 ? 'yes' : 'no';