if()
Evaluates the expression to be executed according to the evaluation result (true/false).
Syntax
if(CONDITION, EXPR_TRUE, EXPR_FALSE)
Required Parameter
CONDITION
- Expression to evaluate. If the conditional statement is
true
or not null, it is evaluated astrue
. EXPR_TRUE
- Expression to be evaluated when the
CONDITION
is evaluated istrue
. EXPR_FALSE
- Expression to be evaluated when the
CONDITION
is evaluated isfalse
.
Usage
Evaluate the status code as ok if it is 200 or as an error if it is not.
if(status == "200", "ok", "error")