This test shows how custom expressions can be added to ZPT-JS. We have written a custom expression class, AverageExpression, available using avg:. It returns the arithmetic average of the values in the expression.

  1. aNumber = 5
  2. from1To3 = [1 2 3]
  3. avg: aNumber 1 = (5 + 1) / 2 = 3 = (5 + 1) / 2 = 3
  4. avg: aNumber 9 from1To3 = (5 + 9 + 1 + 2 + 3) / 5 = 4 = (5 + 4 + 1 + 2 + 3) / 4 = 4