Conditional operator
Conditional (Ternary) Operator ‘?’ Conditional (Ternary) operator takes in three operands: a condition, question mark and an expression to execute if condition is truthy and an expression if condition is falsy. Syntax of the ternary operator: let variablename = condition ? value1 : value2; Condition is evaluated and if truthy, value1 is return otherwise value2. …