The collection.average( ) method returns the arithmetic mean (average) of defined values in the collection instance.
Only numerical elements are taken into account for the calculation (other element types are ignored).
If the collection contains objects, pass the propertyPath parameter to indicate the object property to take into account.
collection.average( ) returns Undefined if:
- the collection is empty,
- the collection does not contain numerical elements,
- propertyPath is not found in the collection.