Reduce constructor
- @required dynamic input,
- @required dynamic initialValue,
- @required dynamic inExpr,
Creates $reduce operator expression
-
input- Can be any valid expression that resolves to an array. If the argument resolves to a value of null or refers to a missing field, $reduce returns null. If the argument does not resolve to an array or null nor refers to a missing field,$reducereturns an error. -
initialValue- The initial cumulative value set beforeinExpris applied to the first element of the input array. -
inExpr- A valid expression that $reduce applies to each element in the input array in left-to-right order. Wrap the input value with $reverseArray to yield the equivalent of applying the combining expression from right-to-left. During evaluation of the in expression, two variables will be available: -
valueis the variable that represents the cumulative value of the expression. -
thisis the variable that refers to the element being processed.
Implementation
Reduce({@required input, @required initialValue, @required inExpr})
: super(
'reduce',
AEObject(
{'input': input, 'initialValue': initialValue, 'in': inExpr}));