# Logic

*Boolean AND operator will be true if and only all the operators are*

*true*

*.*

<

`boolean`

> AND <`boolean`

>boolean

true AND 6 > 5

Return value:

true

*Boolean OR operator will be true if and only the conjunction of all the operators is*

*true*

*.*

<

`boolean`

> OR <`boolean`

>boolean

false OR ("smaug" == null)

Return value:

false

*IF the condition evaluates to true THEN the result equals the*

*first expression*

*; ELSE, the*

*second expression*

*will proceed.*

IF(

*expression*: boolean,*then*: any,*else*: any)*then*: any ||

*else*: any

IF("bilbo" == "baggins", "This is true", "This is false")

Return value:

"This is false"

Returns first expression where the value matches appropriate right operand.

**SWITCH**(

*value*: any[, switchOperand: number,

*expression*: any ],

*default*?: any)

*any*

SWITCH(2, 1, "apples", 2, "pears", 3, "oranges", "no fruits")

Return value:

"pears"

Last modified 1yr ago