if
function, since version 1.0.0
categories: conditionals
if(cond, t, f)
returns t if cond is true, otherwise returns f
parameters
- cond: boolean - condition
- t: any - value to be returned if
condis true - f: any - value to be returned if
condis false - note: parameters
tandfmust have the same type
return type:
any, the same type of parameter t and f
example
if(product.quantity == 10, 'equal to 10', 'not 10')