What is the syntax for conditionals?
if(condition is ture){
//do this
}else if(this is true){
//do this
}else{
//do this
}What are conditional (ternary) operator?
It is an operator that takes in 3 operands: a condition followed by a question mark (?) then an expression to execute the condition if it is truthy followed by a colon (:) and the expression to execute if the condition is falsy.
What are operator is commonly used to replace if…else statement?
A conditional ternary operator
What is the syntax for a ternary operator?
condition ? exprIfTrue : exprIfFalse
What is the definition of ‘truthy’ and ‘falsy’?
‘Truthy’ value is a value that is equal or can be converted to true
‘Falsy’ is a condition that has a value which can be converted to false