Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Ternary operator

condition ? exprIfTrue : exprIfFalse
The conditional (ternary) operator is the only JavaScript operator that takes three operands: a condition followed by a question mark ( ? ), then an expression to execute if the condition is truthy followed by a colon ( : ), and finally the expression to execute if the condition is falsy
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #Ternary #operator
ADD COMMENT
Topic
Name
4+8 =