An expression is a combination of values, constants, variables, operators, or functions, evaluated to produce another value. The resulting value is one of the various data types, such as number, text, boolean, etc.
Expressions are broadly classified by the data type of the result it evaluates. For example:
- Boolean expressions : Evaluate to either TRUE or FALSE
- Number expressions : Evaluate to integers
- Decimal expressions : Evaluate to decimal numbers
- Text expressions : Evaluate to text values
- Date-time expressions : Evaluate to date/time values
- List expressions : Evaluate to list values
- Key-value expressions : Evaluate to map (key-value) values
For example, 2+3; is an numerical expression that evaluates to 5. An example of a text expression is name = "john " + "smith";, which evaluates to "john smith", which is text data type.
The result of an expression is usually assigned to a variable, compared with another value, or simply used to execute various Deluge tasks.
2) name = "John" + "Smith"; // concatenating 2 string values
3) if ( a == b ) // (a == b) is a boolean expression