This topic describes the syntax, description, parameters, and return values of logical functions. This topic also provides examples of these functions.
and
The following table describes the details about this function.
Item | Description |
---|---|
Syntax | and(arg, ...)
|
Benefit |
|
Parameter | The value that you want to check. You can specify one or more values. Data type: any type. |
Return value | Returns true if all values evaluate to true and returns false if a value evaluates to false.
|
Example |
|
or
The following table describes the details about this function.
Item | Description |
---|---|
Syntax | or(arg, ...)
|
Description |
|
Parameter | The value that you want to check. You can specify one or more values. Data type: any type. |
Return value | Returns true if a value evaluates to true and returns false if all values evaluate to false.
|
Example |
|
not
The following table describes the details about this function.
Item | Description |
---|---|
Syntax | not(arg)
|
Description | Executes the NOT logical operator. The values of undef and false evaluate to false, and other values evaluate to true.
|
Parameter | The value that you want to check. You can specify only one value. Data type: any type. |
Return value |
|
Example |
|
eq
The following table describes the details about this function.
Item | Description |
---|---|
Syntax | eq(arg1, arg2)
|
Description | Compares whether two values are equal. |
Parameter |
|
Return value | Returns true if the two values are equal and returns false if they are not equal.
|
Example |
|
ne
The following table describes the details about this function.
Item | Description |
---|---|
Syntax | ne(arg1, arg2)
|
Description | Compares whether two values are not equal. |
Parameter |
|
Return value | Returns true if the two values are not equal and returns false if they are equal.
|
Example |
|
null
The following table describes the details about this function.
Item | Description |
---|---|
Syntax | null(v)
|
Benefit | Checks whether a data type is specified for EdgeScript (ES). |
Filed | v: the parameter to pass. Data type: array, dictionary, or string. A value of false is returned for other data types. |
Return value | Data type: Boolean.
|
Examples | Output:
|