Plus Operator

The "+" operator covers multiple operations:

  • addition of numbers
  • concatenation of strings (for that use case, prefer the "&" operator)
  • offsetting of dates/times
  • concatenation of lists, and values into lists

The type of operation is determined by the left operand, the right operand being converted, as needed:

ExpressionResult
number + rightNumerical: right is converted into a numerical value, as needed.
string + rightString: right is converted into its string representation, as needed.
date + rightDate: the date is shifted by a number of days (or fraction thereof).
right is converted into its numerical representation, as needed.
list + rightList: right is added to the end of list, and the result is eventually flattened.

Examples

"2" + 2 = 22
2 + "2" = 4
List(1) + 2 = List(1, 2)
List(1, 2) + List(3, 4) = List(1, 2, 3, 4)