if()

Evaluates the expression to be executed according to the evaluation result (true/false).

Syntax

if(CONDITION, EXPR_TRUE, EXPR_FALSE)
Required Parameters
CONDITION
Expression to evaluate. If the conditional statement is true or not null, it is evaluated as true.
EXPR_TRUE
Expression to be evaluated when the CONDITION is evaluated is true.
EXPR_FALSE
Expression to be evaluated when the CONDITION is evaluated is false.

Usage

Evaluate the status code as ok if it is 200 or as an error if it is not.

if(status == "200", "ok", "error")