src/operator/group-by-function.js
function avg (arr) {
    if (isArray(arr) && !(arr[0] instanceof Array)) {
        const totalSum = sum(arr);
        const len = arr.length || 1;
        return (Number.isNaN(totalSum) || totalSum instanceof InvalidAwareTypes) ?
                 InvalidAwareTypes.NULL : totalSum / len;
    }
    return InvalidAwareTypes.NULL;
}
function avg (arr) {
    if (isArray(arr) && !(arr[0] instanceof Array)) {
        const totalSum = sum(arr);
        const len = arr.length || 1;
        return (Number.isNaN(totalSum) || totalSum instanceof InvalidAwareTypes) ?
                 InvalidAwareTypes.NULL : totalSum / len;
    }
    return InvalidAwareTypes.NULL;
}
function avg ( arr ) { if ( isArray ( arr ) && ! ( arr [ 0 ] instanceof Array ) ) { const totalSum = sum ( arr ) ; const len = arr . length || 1 ; return ( Number . isNaN ( totalSum ) || totalSum instanceof InvalidAwareTypes ) ? InvalidAwareTypes . NULL : totalSum / len ; } return InvalidAwareTypes . NULL ; }
Reducer function that returns the average of all the values.

@public
@param  {Array.<number>} arr - The input array.
@return {number} Returns the mean value of the array.
Reducer function that returns the average of all the values .