Functions

if

Returns the first val­ue if the con­di­tion is true; oth­er­wise, returns the sec­ond value.

Category
Conditional
Syntax
if(condition, ifTrue, ifFalse)
Operator

? :

if(
    1 + 1 == 2,
    true,
    false
)if(

    /* Check if 1 plus 1 equals 2 */
    1 + 1 == 2,

    /* If it does, displayed a checked box */
    true,

    /* Otherwise, display an unchecked box */
    false
    
)
=
☑️