Ternary OperatorShort conditional syntax. Conditional (Ternary) Operator JavaScript also contains a conditional operator that assigns a value to a variable based on some condition. variablename = (condition) ? value1:value2 Examplelet voteable = (age < 18) ? "Too young" : "Old enough";Try it Yourself PreviousNext